How to self-host or use SRI / CSP with our scripts
In integrating our scripts into your website, you can choose between two main types of JavaScript scripts entrypoints and two Service Worker deployment strategies. This document explains their differences, advantages, drawbacks, and how to implement a secure setup using CSP and SRI.
CSP setup is harder due to multiple dynamic sources
No SRI support for dynamically loaded scripts
Cannot self-host dependent scripts
Example:
🧩 Service Worker Strategies
PushPushGo integration also requires a Service Worker. You have two main options:
Approach
Uses importScripts
CSP-compatible (worker-src 'self')
SRI Support
Self-hostable
ImportScripts
✅ Yes
❌ No
❌ No
❌ No
Downloaded
❌ No
✅ Yes
✅ (N/A)
✅ Yes
✅ Recommended for better security: Downloaded Worker (sw.js)
Benefits:
Allows full control over CSP (worker-src 'self')
Self-hostable and auditable
How to fetch:
HTML CSP Example:
❄️ Freeze Mode Explained
PushPushGo offers a feature called Freeze. When enabled:
The project configuration is locked. Any future changes made in the dashboard (e.g., selectors, feature toggles, popup forms) will not propagate to production environments.
This is especially useful when you:
Host AIO scripts or workers from our CDN and want to control, audit our "changes"
Want stable script versions without unexpected changes
Need to ensure CSP and SRI hashes remain valid
How to enable Freeze:
Go to: Project > Settings > Integration > Web push integration
Enable the Freeze option
Wait 2–3 minutes for CDN cache to sync
✅ Recommended for secure setup (All-in-One)
Use aio.js
Calculate SHA-384 hash (update {projectId} before execute):
Update <script> tag with SRI
Download and host sw.js locally
Final CSP example:
🔁 Update Checklist (AIO mode)
Fetch new version of aio.js
Recalculate SHA-384 SRI hash
Update script tag in HTML
Update CSP meta tag with new 'sha384-...'
Update local sw.js
Stay secure! if you have any questions please contact with our customer support