Adopt AI is built with enterprise-grade security in mind. This page explains how to safely deploy the SDK in environments that enforce Content Security Policy (CSP), and how to properly apply nonces when needed.If your application uses a CSP to restrict which scripts and styles can run, you’ll need to follow these steps to ensure the Adopt Copilot loads without triggering CSP violations.
A Content Security Policy (CSP) is a security feature that prevents unauthorized scripts or styles from being injected into your application. It works by explicitly allowing (or blocking) resources based on source, path, or nonce.Without proper CSP configuration, your browser may block the Adopt AI SDK from running.
If you’re using the Script/CDN method, you can pass the nonce directly into the script tag via a data-nonce attribute. Adopt will automatically detect and use it.Example →
If you’re using the NPM package, you’ll need to pass the nonce explicitly when calling init().Example →
Copy
import { init, boot } from '@adoptai/sdk';init('your-license-key', { nonce: 'abc123' // Same value as used in your script tag});boot('user-123', { name: 'John Doe', email: 'john@example.com'}, { products: ['sidebar', 'spotlight']});
Make sure the nonce matches the one declared in your CSP meta tag. Otherwise, the browser may still block execution.
Now that your environment is secure and compliant, let’s explore how Adopt works with modern frontend frameworks like **Single Page Applications. **Learn how to support route changes, dynamic mounting, and SPA-specific behavior.