I’m trying to embed my Vercel-hosted page into a CRM that allows embedding via iframe by simply adding the page’s URL. However, it seems that the Vercel page is being blocked from displaying in an iframe.
I tried adding the following configuration to my next.config.mjs file:
After deploying this change, I checked the headers using DevTools, but I don’t see the Content-Security-Policy header in the response when loading the page in a normal browser.
Has anyone successfully allowed iframe embedding for a Vercel-hosted page? Any insights or guidance would be greatly appreciated!
Hi Pauline. I am not sure. I am not opening two vercel pages inside each other. I am just trying to get the headers to show that I added in the next.config.mjs file
is this not the spot to add them. When I deploy this and look in the console in the browser they are not there so of course it won’t work in an iframe. Just trying to see them in a browser first and go from there to see if that works. I do not know which file that other guy has it code in that you posted and his situation seems different.