Hello everyone,
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:
/** @type {import('next').NextConfig} */const nextConfig = { reactStrictMode: true, async headers() { return [ { source: "/(.*)", headers: [ { key: "Content-Security-Policy", value: "frame-ancestors 'self' https://my-crm-domain.com" } ] } ]; }};
export default nextConfig;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!
Thanks in advance!