Content Security Policy
If your app sends a Content-Security-Policy, add Neaten's two hosts to it. Neaten needs no 'unsafe-inline' and no 'unsafe-eval', and works with Trusted Types.
script-src https://cdn.tryneaten.com
connect-src https://cdn.tryneaten.com https://api.tryneaten.com
Add these to the directives you already have; don't replace them. If your policy only has default-src, add the two directives above, with your own sources in them as well.
| Directive | Add | Why |
|---|---|---|
script-src | https://cdn.tryneaten.com | The loader (/v1/loader.js), and the two files it adds from /v1/r/: the renderer when a tour is about to show, and the editor when you build tours on your site. |
connect-src | https://cdn.tryneaten.com | Your published tours (/c/<key>/…), read with fetch. |
connect-src | https://api.tryneaten.com | Tour events (/e), a signed-in person's progress across devices (/s), previews from the dashboard (/preview/…), and the editor (/edit/…). |
img-src | The hosts of images in your tours | Only if a step shows an image. Images are https:// addresses you choose; Neaten doesn't host them. |
style-src | Nothing | Tours are styled through one constructed stylesheet in a shadow root and positioned with style.setProperty: no <style> tags and no style attributes. |
font-src | Nothing | Tours use your page's font, or a font family you set in the theme that your page already loads. Neaten loads no font files. |
frame-src | Nothing | Neaten adds no frames to your page. |
trusted-types | neaten | Only if you use require-trusted-types-for 'script'. The loader makes one policy, neaten, that only accepts its own two file addresses. |
frame-ancestors | https://app.tryneaten.com (optional) | Canvas in the dashboard shows your app in a frame. If your app doesn't allow that, Canvas opens it in a new tab instead, with the same editor. |
With a nonce
If your policy allows scripts by nonce with 'strict-dynamic', put your nonce on the tag and you don't need the CDN in script-src. The loader passes the nonce on to the files it adds. With npm, pass it to init({ key, nonce }). connect-src still needs both hosts.
<script async nonce="RANDOM_PER_RESPONSE" src="https://cdn.tryneaten.com/v1/loader.js" data-key="pk_live_…"></script>
script-src 'nonce-RANDOM_PER_RESPONSE' 'strict-dynamic'
Check it
The dashboard's install check opens your page with your real policy and says, in plain words, if the policy blocks Neaten's script or its connections, and what to add.