Docs

Content security policy

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.com when using the hosted script.
  • connect-src: allow https://spryui.com for configuration and analytics requests.
  • Styles: the browser SDK creates inline styles. Your style policy must permit them, including style-src-elem and style-src-attr if 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.