Scripts
If your CSP includesscript-src or default-src directive, you must make sure that:
- The policy allows the page to load Theymes SDK script from
assets.theymes.com. If you installed the SDK from NPM, this is not necesary. - The policy allows Theymes SDK to execute its inline scripts. You can either do this by specifying
'unsafe-inline'keyword, or using a nonce.
'nonce-{RANDOM}' keyword in your directive.
When calling theymes.initialize() you should pass the nonce in the options argument. The SDK will then inject the nonce to all inline script tags.
Here’s an example CSP that includes a valid script-src policy:
Connect & frames
If your CSP includesframe-src, connect-src or default-src directives, you must make sure that the policy allows your Theymes domain, eg. <company>.theymes.com.
Here’s an example CSP that includes a valid frame-src and connect-src policy:
Stylesheets
If your CSP includesstyle-src or default-src directive, you must make sure that the policy allows inline stylesheets from Theymes SDK. You can do this either by using 'unsafe-inline' keyword, or using a nonce.
See the scripts section for information about using a nonce.
Theymes always uses the same nonce passed to
theymes.initialize() for both inline scripts and stylesheets.Custom fonts
If you use custom fonts, and you use eitherfont-src or default-src, you must make sure that the policy allows those fonts to be loaded.
Here is an example CSP that includes a valid font-src policy for google fonts: