Documentation
Content Security Policy
If your website uses a Content Security Policy, allow the SpryUI script, API requests, and banner styles in your existing policy.
When you need this
This guide is for developers managing a website’s Content Security Policy (CSP). If the browser console reports that SpryUI was blocked by CSP, update the relevant directives in your existing policy.
Allow the required resources
- script-src: allow
https://spryui.comwhen using the hosted script. - connect-src: allow
https://spryui.comfor configuration and analytics requests. - Styles: the browser SDK creates inline styles. Your style policy must permit them, including
style-src-elemandstyle-src-attrif those are set separately.
The inline initialization snippet also needs permission under your script policy. Use your site’s nonce or hash mechanism, or put the initialization in an allowed external JavaScript file.
Keep the rest of your existing policy. These requirements are additions, not a complete replacement policy.
Verify
Reload the page with the browser console open. Check that the SDK loads, the banner appears, and a click is recorded in Analytics. Use debug mode to inspect failures.