From bfd1efc46bb20429d75920d0ef0a5de9a0ba3baf Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 22:47:14 +0000 Subject: [PATCH] =?UTF-8?q?Document=20settings.iframe.allowed-parent-origi?= =?UTF-8?q?ns=20in=20site=20settings=20and=20em=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/customization/embedded-mode.mdx | 16 ++++++++++++ .../pages/navigation/site-level-settings.mdx | 26 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/fern/products/docs/pages/customization/embedded-mode.mdx b/fern/products/docs/pages/customization/embedded-mode.mdx index 6828d1d76c..193b06f783 100644 --- a/fern/products/docs/pages/customization/embedded-mode.mdx +++ b/fern/products/docs/pages/customization/embedded-mode.mdx @@ -29,6 +29,22 @@ Add the `embedded=true` query parameter to the URL: Embedded mode persists across navigation within a session, so internal links keep it active without the query string on every URL. +## Allow third-party origins to frame your docs + +By default, Fern sets a `Content-Security-Policy: frame-ancestors 'self' https://*.buildwithfern.com` header on every page, which prevents third-party sites from embedding your docs in an iframe. The `?embedded=true` mode omits `frame-ancestors` entirely, allowing any origin to frame the page. + +To allow specific third-party origins to frame your docs without using `?embedded=true`, add them to `settings.iframe.allowed-parent-origins` in `docs.yml`: + +```yaml docs.yml +settings: + iframe: + allowed-parent-origins: + - https://app.trumpet.app + - https://*.example.com +``` + +Each entry must be a valid CSP host source (`scheme://host[:port]`). Wildcards on the host label (`https://*.example.com`) are supported; bare `*`, keyword sources, and scheme-only values are rejected. The configured origins are appended to the default `frame-ancestors`, so `'self'` and `https://*.buildwithfern.com` remain in place. + ## Embed external pages [Embedding external pages in your docs](/learn/docs/writing-content/markdown-media#embed-external-sites) uses the same `