Use a strict CSP
The script operates with a strict Content Security Policy. It does not use eval or inline styles, and it is compatible with Trusted Types. Use this page to allow the script in your policy.
Procedure
Add the CDN to
script-src:textscript-src 'self' https://cdn.jsdelivr.net;Add the endpoint to
connect-src. When you use a first party endpoint, add your endpoint in its place:textconnect-src 'self' https://in.quickpipe.ai;Use the script tag with a fixed version and the
integrityattribute, as QuickPipe gives it:html<script async src="https://cdn.jsdelivr.net/npm/@quickpipeaiab/[email protected]/dist/lg.js" integrity="sha384-…" crossorigin="anonymous" data-key="lg-pub-live-…"></script>
Result
The browser runs the script only when the file has the correct hash. The adapters come from the same CDN, and the core checks their hashes.
The stub
The stub window.lg=window.lg||function(){…} is an inline script. With a strict policy, put the stub in a file on your domain, or add its hash to script-src.
The hashes
The hash of each browser file is in integrity.json, in the npm package and in the GitHub release of each version. Use a URL with a fixed version. A URL without a fixed version cannot have an integrity attribute.