Store Settings
Security
Security configuration lets you customize the Content Security Policy (CSP) for your customer-facing website. CSP controls which external resources your store can load, helping protect against cross-site scripting and other attacks.
What is CSP?
Content Security Policy is a security feature that tells browsers which sources are allowed to load content on your website.
Default CSP configuration
Your store comes with a pre-configured CSP that includes hosts for Google Analytics, Google Tag Manager, Microsoft Clarity, Stripe, Revolut, Facebook, Cloudflare, and Google Fonts.
You only need to add additional hosts if you use third-party services not already included in the default configuration.
Configuring CSP
- From your admin, go to Settings > Security Configuration
- Add hosts to the appropriate CSP directive
- Click Save changes
CSP directives
connect-src
Controls which hosts your store can connect to for:
- API requests (fetch, XMLHttpRequest)
- WebSocket connections
Add hosts here for third-party APIs or services your store communicates with.
script-src
Controls which hosts can provide JavaScript files. Add hosts here for:
- Analytics scripts
- Chat widgets
- Payment processing scripts
img-src
Controls which hosts can provide images. Add hosts here for:
- External image hosting
- Third-party badges or logos
frame-src
Controls which hosts can be embedded in iframes. Add hosts here for:
- Embedded payment forms
- Video players
- Third-party widgets
Adding hosts
For each directive, you can add multiple hosts:
- Click Add Host
- Enter the host URL (e.g.,
https://example.com) - Repeat for additional hosts
- Click Save changes
Wildcards
You can use wildcards to allow subdomains. For example, https://*.example.com allows all subdomains of example.com.
Common examples
| Service | Directive | Host |
|---|---|---|
| Google Analytics | script-src, connect-src | https://*.google-analytics.com |
| Facebook Pixel | script-src, connect-src | https://*.facebook.com |
| Stripe | script-src, frame-src | https://*.stripe.com |
| YouTube embeds | frame-src | https://*.youtube.com |
Important
Only add hosts you trust. Each additional host increases your attack surface. CSP keywords like 'unsafe-inline' or 'self' are not permitted.
Next steps
- Manage users and their permissions
- Set up webhooks for integrations