Issue with Vercel API Deployment: Page Blocked in iFrame

I have a problem when I deploy from vercel api and then I want to use the deploy to show it in an iframe it tells me the page is blocked and when I deploy the same repository manually it doesn’t give me that error in the iframe as additional information. page works fine, that is, the deploy is done, the only thing it doesn’t work in the iframe

 const vercelResponse = await fetch("https://api.vercel.com/v13/deployments", {
          method: "POST",
          headers: {
            Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
            "Content-Type": "application/json"
          },
          body: JSON.stringify({
            name: repoName,
            gitSource: {
              type: "github",
              repo: `${repoData.data.owner.login}/${repoData.data.name}`,
              ref: repoData.data.default_branch,
              repoId: repoId,
            },
            project: repoName,
            projectSettings: {
              framework: "nextjs",
              buildCommand: "npm run build",
              outputDirectory: ".next",
              installCommand: "npm install",
              devCommand: "npm run dev",
            },
            target: "production",
          })
        });
  
        const responseData = await vercelResponse.json();
  
        if (!vercelResponse.ok) {
          const errorData = responseData as VercelApiError;
          throw new Error(`Failed to create Vercel deployment: ${errorData.error.message}`);
        }
  
        const vercelData = responseData as VercelDeployment;
        vercelDeploymentUrl = `https://${vercelData.url}`;

Hi, Spaceui! Welcome to the Vercel Community :smile:

Let me try and help out here! To clarify:

  • When you deploy via the API, your iFrame (which displays deployment status on your page) doesn’t work
  • However, when you deploy manually via the dashboard, the iFrame DOES work?