Configure Content Security Policy for the Subtext Capture Snippet
Allow the Subtext capture snippet’s script and network requests through your app’s Content Security Policy.
If your app sends a Content-Security-Policy, it blocks the capture snippet’s script from loading and the SDK’s network calls from reaching Fullstory until your policy allows them. You need to allow both Fullstory hosts across three directives — script-src, connect-src, and img-src. Update the policy before you install the snippet so capture works from the first page load.
Update the policy before you install the snippet. If you leave a restrictive policy in place, capture silently fails — the script never loads and no errors surface to your users.
Add the Fullstory ingestion host so image-based capture requests aren’t blocked.
img-src 'self' https://rs.fullstory.com;
Other directives
frame-src does not require any Fullstory additions. Most apps do not need other directive changes beyond the script-src, connect-src, and img-src above.
After you deploy the CSP change, open the browser devtools network tab and confirm:
fs.js loads from edge.fullstory.com with status 200.
Outbound POSTs to rs.fullstory.com succeed.
The console shows no CSP violation reports referencing Fullstory hosts.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Subtext","colors":{"primary":"#f5447b","light":"#f87ca3","dark":"#f5447b"},"logo":{"light":"https://mintcdn.com/subtext-d7d5eca1/1gs3LpC3WUIh8bo9/images/logo-light.png?fit=max\u0026auto=format\u0026n=1gs3LpC3WUIh8bo9\u0026q=85\u0026s=b488fd2892a34b9c36aceab033835884","dark":"https://mintcdn.com/subtext-d7d5eca1/1gs3LpC3WUIh8bo9/images/logo-dark.png?fit=max\u0026auto=format\u0026n=1gs3LpC3WUIh8bo9\u0026q=85\u0026s=1131c2fac67a51622cd90635c8b753d2","href":"https://subtext.fullstory.com"},"favicon":{"light":"https://mintcdn.com/subtext-d7d5eca1/1gs3LpC3WUIh8bo9/favicon.png?fit=max\u0026auto=format\u0026n=1gs3LpC3WUIh8bo9\u0026q=85\u0026s=9024c3ef6e2032fba159816ae3b3c945","dark":"https://mintcdn.com/subtext-d7d5eca1/1gs3LpC3WUIh8bo9/favicon-dark.png?fit=max\u0026auto=format\u0026n=1gs3LpC3WUIh8bo9\u0026q=85\u0026s=0e0811fdba579c1fa28d11aef7089502"},"navbar":{"primary":{"type":"button","label":"Get Started","href":"https://app.fullstory.com/subtext/signup"}},"footer":{"socials":{"x":"https://x.com/subtextdev","github":"https://github.com/fullstorydev/subtext","linkedin":"https://www.linkedin.com/showcase/subtextdev"},"links":[{"header":"Product","items":[{"label":"Home","href":"https://subtext.fullstory.com"},{"label":"Playground","href":"https://subtext.fullstory.com/playground"},{"label":"Blog","href":"https://subtext.fullstory.com/blog"}]},{"header":"Company","items":[{"label":"Privacy","href":"https://www.fullstory.com/legal/privacy-policy"},{"label":"Terms","href":"https://subtext.fullstory.com/tos"}]}]},"fonts":{"family":"Sora"},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode","mcp"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"subtext-d7d5eca1","hasAudioNarration":false,"actualSubdomain":"subtext-d7d5eca1","customDomains":["subtext.fullstory.com"],"gitSource":{"type":"github","owner":"fullstorydev","repo":"subtext-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10f66f9ffae5051c419a48"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aa84516a7294f9e378954a2","clientVersion":"0.0.4448","searchFilterCounts":[{"language":"default","tag":"Docs","count":46},{"language":"default","tag":"Integrations","count":23},{"language":"default","tag":"Verify (Beta)","count":8},{"language":"default","tag":"Install by Framework","count":5},{"language":"default","tag":"Tools Reference","count":5},{"language":"default","tag":"API reference","count":4},{"language":"default","tag":"Get Started","count":4},{"language":"default","tag":"Recipes","count":4},{"language":"default","tag":"Privacy","count":3},{"language":"default","tag":"Session Review","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"#assistant-entry,#assistant-entry-mobile{display:none}"}]}
{"page":{"pagePath":"api/csp","slug":"/api/csp","pageMetadata":{"title":"Configure Content Security Policy for the Subtext Capture Snippet","sidebarTitle":"CSP","description":"Allow the Subtext capture snippet's script and network requests through your app's Content Security Policy.","href":"/api/csp"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Allow the Subtext capture snippet’s script and network requests through your app’s Content Security Policy.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`If your app sends a `,_jsx(_components.code,{children:`Content-Security-Policy`}),`, it blocks the capture snippet’s script from loading and the SDK’s network calls from reaching Fullstory until your policy allows them. You need to allow both Fullstory hosts across three directives — `,_jsx(_components.code,{children:`script-src`}),`, `,_jsx(_components.code,{children:`connect-src`}),`, and `,_jsx(_components.code,{children:`img-src`}),`. Update the policy before you `,_jsx(_components.a,{href:`/install/overview`,children:`install the snippet`}),` so capture works from the first page load.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Update the policy before you install the snippet. If you leave a restrictive policy in place, capture silently fails — the script never loads and no errors surface to your users.`})}),`\n`,_jsx(Heading,{level:`2`,id:`where-csp-lives`,children:`Where CSP lives`}),`\n`,_jsx(_components.p,{children:`Look for the policy in these places:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Framework config — `,_jsx(_components.code,{children:`next.config.js`}),` (`,_jsx(_components.code,{children:`headers()`}),`), `,_jsx(_components.code,{children:`vercel.json`}),`, `,_jsx(_components.code,{children:`netlify.toml`}),` `,_jsx(_components.code,{children:`[[headers]]`}),` blocks.`]}),`\n`,_jsxs(_components.li,{children:[`Middleware — Express/Fastify `,_jsx(_components.code,{children:`helmet`}),`, Next.js `,_jsx(_components.code,{children:`middleware.ts`}),`, custom response-header middleware.`]}),`\n`,_jsxs(_components.li,{children:[`HTML meta tag — `,_jsx(_components.code,{children:`\u003cmeta http-equiv=\"Content-Security-Policy\" content=\"...\">`}),` in the HTML entry point.`]}),`\n`,_jsx(_components.li,{children:`Hosting platform — Vercel/Netlify/Cloudflare dashboard or Workers script.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`required-directives`,children:`Required directives`}),`\n`,_jsx(Heading,{level:`3`,id:`script-src`,children:_jsx(_components.code,{children:`script-src`})}),`\n`,_jsxs(_components.p,{children:[`Add both Fullstory hosts. The snippet runs an inline bootstrap, so you also need `,_jsx(_components.code,{children:`'unsafe-inline'`}),` — or a nonce.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`script-src 'self' https://edge.fullstory.com https://rs.fullstory.com 'unsafe-inline';`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`If you already use nonces, prefer that approach:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`script-src 'self' https://edge.fullstory.com https://rs.fullstory.com 'nonce-\u003cRANDOM>';`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Then add the nonce to the snippet’s `,_jsx(_components.code,{children:`\u003cscript>`}),` tag.`]}),`\n`,_jsx(Heading,{level:`3`,id:`connect-src`,children:_jsx(_components.code,{children:`connect-src`})}),`\n`,_jsx(_components.p,{children:`Add both Fullstory hosts so the SDK can reach edge and ingestion.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`connect-src 'self' https://edge.fullstory.com https://rs.fullstory.com;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`img-src`,children:_jsx(_components.code,{children:`img-src`})}),`\n`,_jsx(_components.p,{children:`Add the Fullstory ingestion host so image-based capture requests aren’t blocked.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`img-src 'self' https://rs.fullstory.com;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`other-directives`,children:`Other directives`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`frame-src`}),` does not require any Fullstory additions. Most apps do not need other directive changes beyond the `,_jsx(_components.code,{children:`script-src`}),`, `,_jsx(_components.code,{children:`connect-src`}),`, and `,_jsx(_components.code,{children:`img-src`}),` above.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example-full-next-js-header`,children:`Example: full Next.js header`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// next.config.js`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`module`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`exports`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` headers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` source:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '/(.*)'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` key:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Security-Policy'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default-src 'self'\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"script-src 'self' https://edge.fullstory.com https://rs.fullstory.com 'unsafe-inline'\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"connect-src 'self' https://edge.fullstory.com https://rs.fullstory.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"style-src 'self' 'unsafe-inline'\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"img-src 'self' data: https://rs.fullstory.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ].`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`join`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'; '`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`verifying`,children:`Verifying`}),`\n`,_jsx(_components.p,{children:`After you deploy the CSP change, open the browser devtools network tab and confirm:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`fs.js`}),` loads from `,_jsx(_components.code,{children:`edge.fullstory.com`}),` with status 200.`]}),`\n`,_jsxs(_components.li,{children:[`Outbound POSTs to `,_jsx(_components.code,{children:`rs.fullstory.com`}),` succeed.`]}),`\n`,_jsx(_components.li,{children:`The console shows no CSP violation reports referencing Fullstory hosts.`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Configure Content Security Policy for the Subtext Capture Snippet","sidebarTitle":"CSP","description":"Allow the Subtext capture snippet's script and network requests through your app's Content Security Policy.","href":"/api/csp"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Where CSP lives","slug":"where-csp-lives","depth":2,"children":[]},{"title":"Required directives","slug":"required-directives","depth":2,"children":[{"title":"script-src","slug":"script-src","depth":3,"children":[]},{"title":"connect-src","slug":"connect-src","depth":3,"children":[]},{"title":"img-src","slug":"img-src","depth":3,"children":[]}]},{"title":"Other directives","slug":"other-directives","depth":2,"children":[]},{"title":"Example: full Next.js header","slug":"example-full-next-js-header","depth":2,"children":[]},{"title":"Verifying","slug":"verifying","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/subtext-d7d5eca1/80c624cad0922853/subtext-capture.js"],"subdomain":"subtext-d7d5eca1","siteName":"Subtext","title":"Configure Content Security Policy for the Subtext Capture Snippet - Subtext","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-16T17:33:21.745Z","originalFileLocation":"api/csp.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Allow the Subtext capture snippet\u0026#x27;s script and network requests through your app\u0026#x27;s Content Security Policy.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Subtext\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Configure Content Security Policy for the Subtext Capture Snippet - Subtext\">\u003cmeta data-mint-head property=\"og:description\" content=\"Allow the Subtext capture snippet\u0026#x27;s script and network requests through your app\u0026#x27;s Content Security Policy.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Subtext\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://subtext.fullstory.com/docs/api/csp\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://subtext-d7d5eca1.mintlify.site/docs/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Configure+Content+Security+Policy+for+the+Subtext+Capture+Snippet\u0026amp;description=Allow+the+Subtext+capture+snippet%27s+script+and+network+requests+through+your+app%27s+Content+Security+Policy.\u0026amp;theme=27938e22915c6efe28d6f40e\u0026amp;signature=51cf5d3f9f174b05a3106c7ce7f535985e8e097968287599fe5a7c6bbb8605e7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Configure Content Security Policy for the Subtext Capture Snippet - Subtext\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Allow the Subtext capture snippet\u0026#x27;s script and network requests through your app\u0026#x27;s Content Security Policy.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://subtext-d7d5eca1.mintlify.site/docs/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Configure+Content+Security+Policy+for+the+Subtext+Capture+Snippet\u0026amp;description=Allow+the+Subtext+capture+snippet%27s+script+and+network+requests+through+your+app%27s+Content+Security+Policy.\u0026amp;theme=27938e22915c6efe28d6f40e\u0026amp;signature=51cf5d3f9f174b05a3106c7ce7f535985e8e097968287599fe5a7c6bbb8605e7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/subtext-d7d5eca1/XgBioRa9qGArLPV3/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Subtext\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f5447b\">\u003clink data-mint-head rel=\"canonical\" href=\"https://subtext.fullstory.com/docs/api/csp\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api/csp.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://subtext.fullstory.com/#organization\",\"name\":\"Subtext\",\"url\":\"https://subtext.fullstory.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/subtext-d7d5eca1/1gs3LpC3WUIh8bo9/images/logo-light.png?fit=max\u0026auto=format\u0026n=1gs3LpC3WUIh8bo9\u0026q=85\u0026s=b488fd2892a34b9c36aceab033835884\"}},{\"@type\":\"WebSite\",\"@id\":\"https://subtext.fullstory.com/docs#website\",\"name\":\"Subtext\",\"url\":\"https://subtext.fullstory.com/docs\",\"publisher\":{\"@id\":\"https://subtext.fullstory.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://subtext.fullstory.com/docs/api/csp#webpage\",\"url\":\"https://subtext.fullstory.com/docs/api/csp\",\"name\":\"Configure Content Security Policy for the Subtext Capture Snippet\",\"description\":\"Allow the Subtext capture snippet's script and network requests through your app's Content Security Policy.\",\"dateModified\":\"2026-07-16T17:33:21.745Z\",\"isPartOf\":{\"@id\":\"https://subtext.fullstory.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://subtext.fullstory.com/docs/api/csp#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://subtext.fullstory.com/docs/api/csp#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API reference\",\"item\":\"https://subtext.fullstory.com/docs/api/get-session\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configure Content Security Policy for the Subtext Capture Snippet\",\"item\":\"https://subtext.fullstory.com/docs/api/csp\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://subtext.fullstory.com/docs/api/csp#article\",\"headline\":\"Configure Content Security Policy for the Subtext Capture Snippet\",\"name\":\"Configure Content Security Policy for the Subtext Capture Snippet\",\"description\":\"Allow the Subtext capture snippet's script and network requests through your app's Content Security Policy.\",\"url\":\"https://subtext.fullstory.com/docs/api/csp\",\"mainEntityOfPage\":{\"@id\":\"https://subtext.fullstory.com/docs/api/csp#webpage\"},\"dateModified\":\"2026-07-16T17:33:21.745Z\",\"publisher\":{\"@id\":\"https://subtext.fullstory.com/#organization\"},\"isPartOf\":{\"@id\":\"https://subtext.fullstory.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Subtext\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Subtext\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/api/csp.md","siteName":"Subtext","nav":{"global":null,"tabs":[{"tab":"Docs","groups":[{"group":"Get Started","pages":[{"title":"Subtext: Session Replay and Devtools Built for AI Agents","sidebarTitle":"Introduction","href":"/introduction"},{"title":"Subtext Quickstart: Set Up Session Replay for AI Agents","sidebarTitle":"Quickstart","href":"/quickstart"},{"title":"Subtext Installation: Snippet and MCP Server Overview","sidebarTitle":"Overview","href":"/install/overview"},{"title":"Subtext Capture Snippet: What It Is and How It Works","sidebarTitle":"Snippet","href":"/install/snippet"}]},{"group":"Install by Framework","pages":[{"title":"Install Subtext in a Next.js App Router Application","sidebarTitle":"Next.js App Router","href":"/install/next-app-router"},{"title":"Install the Subtext Snippet in Your React Application","sidebarTitle":"React","href":"/install/react"},{"title":"Install the Subtext Snippet in Your Vite Application","sidebarTitle":"Vite","href":"/install/vite"},{"title":"Install the Subtext Snippet in Your Remix Application","sidebarTitle":"Remix","href":"/install/remix"},{"title":"Manually Install and Configure Subtext Step by Step","sidebarTitle":"Manual Install","href":"/install/manual"}]},{"group":"Session Review","pages":[{"title":"Session Review: AI Agent Debugging from Real Sessions","sidebarTitle":"Overview","href":"/session-review/overview"},{"title":"Subtext Session Review: Complete MCP Tools Reference","sidebarTitle":"Tools Reference","href":"/session-review/tools-reference"},{"title":"Subtext Skills: Agent Workflows for Session Review","sidebarTitle":"Skills","href":"/session-review/skills"}]},{"group":"Privacy","pages":[{"title":"Privacy and PII Governance for Agent Sessions in Subtext","sidebarTitle":"Overview","href":"/privacy/overview"},{"title":"Subtext Privacy MCP Tools: Complete Reference Guide","sidebarTitle":"Tools Reference","href":"/privacy/tools-reference"},{"title":"Tagging Sensitive Elements for Masking and Exclusion","sidebarTitle":"Sensitive elements","href":"/privacy/sensitive-elements"}]},{"group":"Integrations","pages":[{"title":"Integrations: Jump from Your Tools into the Session","sidebarTitle":"Overview","href":"/integrations/overview"},{"title":"Amplitude and Subtext: From a Signal to the Session","sidebarTitle":"Amplitude","href":"/integrations/amplitude"},{"title":"Appcues and Subtext: From a Flow to the Session","sidebarTitle":"Appcues","href":"/integrations/appcues"},{"title":"ClickHouse and Subtext: From a Query to the Session","sidebarTitle":"ClickHouse","href":"/integrations/clickhouse"},{"title":"Datadog and Subtext: From a Signal to the Session","sidebarTitle":"Datadog","href":"/integrations/datadog"},{"title":"GrowthBook and Subtext: From an Experiment Result to the Session","sidebarTitle":"GrowthBook","href":"/integrations/growthbook"},{"title":"Hightouch and Subtext: From a Cohort to the Session","sidebarTitle":"Hightouch","href":"/integrations/hightouch"},{"title":"Intercom and Subtext: From a Conversation to the Session","sidebarTitle":"Intercom","href":"/integrations/intercom"},{"title":"LangSmith and Subtext: From a Signal to the Session","sidebarTitle":"LangSmith","href":"/integrations/langsmith"},{"title":"LaunchDarkly and Subtext: From a Flag to the Session","sidebarTitle":"LaunchDarkly","href":"/integrations/launchdarkly"},{"title":"LogRocket and Subtext: From a Signal to the Session","sidebarTitle":"LogRocket","href":"/integrations/logrocket"},{"title":"Metabase and Subtext: From a Signal to the Session","sidebarTitle":"Metabase","href":"/integrations/metabase"},{"title":"Mixpanel and Subtext: From a Signal to the Session","sidebarTitle":"Mixpanel","href":"/integrations/mixpanel"},{"title":"New Relic and Subtext: From a Signal to the Session","sidebarTitle":"New Relic","href":"/integrations/newrelic"},{"title":"OpenTelemetry and Subtext: From a Trace to the Session","sidebarTitle":"OpenTelemetry","href":"/integrations/opentelemetry"},{"title":"Pendo and Subtext: From a Signal to the Session","sidebarTitle":"Pendo","href":"/integrations/pendo"},{"title":"PostHog and Subtext: From a Signal to the Session","sidebarTitle":"PostHog","href":"/integrations/posthog"},{"title":"Segment and Subtext: From a Signal to the Session","sidebarTitle":"Segment","href":"/integrations/segment"},{"title":"Sentry and Subtext: From an Error to the Session","sidebarTitle":"Sentry","href":"/integrations/sentry"},{"title":"Snowplow and Subtext: From a Signal to the Session","sidebarTitle":"Snowplow","href":"/integrations/snowplow"},{"title":"Sprig and Subtext: From a Survey Response to the Session","sidebarTitle":"Sprig","href":"/integrations/sprig"},{"title":"Statsig and Subtext: From a Signal to the Session","sidebarTitle":"Statsig","href":"/integrations/statsig"},{"title":"Userpilot and Subtext: From a Flow Drop to the Session","sidebarTitle":"Userpilot","href":"/integrations/userpilot"}]},{"group":"Recipes","pages":[{"title":"Linear and Subtext: Triage from the Real Session","sidebarTitle":"Linear triage","href":"/recipes/linear"},{"title":"LangSmith Trace Review: From a Flagged Run to the User's Session","sidebarTitle":"LangSmith trace review","href":"/recipes/langsmith-trace-review"},{"title":"UX Digest: The Top Five Things to Fix, From Real Sessions","sidebarTitle":"UX digest","href":"/recipes/ux-digest"},{"title":"UX Digest at Scale: Several Areas, Several Teams, One Pipeline","sidebarTitle":"UX digest at scale","href":"/recipes/ux-digest-scaled"}]},{"group":"API reference","pages":[{"title":"Get a link to the current session recording","sidebarTitle":"Get session URL","href":"/api/get-session"},{"title":"Identify Users in Your Subtext Sessions","sidebarTitle":"Identification","href":"/api/identification"},{"title":"Mark Sensitive Elements with Privacy Classes","sidebarTitle":"Privacy classes","description":"Add FullStory privacy CSS classes like fs-exclude, fs-mask, and fs-unmask to your markup to exclude or mask sensitive elements from session capture.","href":"/api/privacy-classes"},{"title":"Configure Content Security Policy for the Subtext Capture Snippet","sidebarTitle":"CSP","href":"/api/csp"}]}]},{"tab":"Verify (Beta)","pages":[{"title":"Verify (Beta)","href":"/verify/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Configure Content Security Policy for the Subtext Capture Snippet - Subtext","deploymentId":"dpl_hSqyvJ4yQMj8zFViHgqnZFPm1xMv","buildId":"dpl_hSqyvJ4yQMj8zFViHgqnZFPm1xMv","dynamics":[],"chunks":[]}