# Fix Content Security Policy (CSP) errors

When a Content-Security-Policy header blocks the script, add SuprAnalytics to script-src and connect-src, and to img-src and media-src for live chat.

If your website sends a `Content-Security-Policy` header, the browser blocks scripts and requests to hosts it doesn't list. The console shows something like "Refused to load the script".

Add SuprAnalytics's address to `script-src` (the script) and `connect-src` (its events):

```
Content-Security-Policy: script-src 'self' https://supranalytics.app; connect-src 'self' https://supranalytics.app;
```

- With the [managed proxy](https://supranalytics.app/docs/managed-proxy.md), list your proxy subdomain (`https://a.yourdomain.com`) instead.
- With [session recordings](https://supranalytics.app/docs/session-recordings.md) or [heatmaps](https://supranalytics.app/docs/heatmaps.md) on, keep SuprAnalytics's address (https://supranalytics.app) in `script-src` and `connect-src` even with a proxy: the recorder (`/js/recorder.js`) and what it sends (`/api/recording`, `/api/heat`) always use it.
- With [live chat](https://supranalytics.app/docs/live-chat.md), also add SuprAnalytics's address to `img-src` (logos, avatars and pictures) and `media-src` (videos people send).
- Next.js: the header is usually set in `next.config.js` (`headers()`) or your proxy file.

---

This page on the web: https://supranalytics.app/docs/csp
Every documentation page: https://supranalytics.app/docs.md
