Adding our script
There are two ways to add cside to your site. Choose the method that fits your setup:
| Method | Best for |
|---|---|
| CLI tool | Static sites (SSG), zero-code integration |
| Manual script | SSR applications, custom setups |
Option 1: CLI tool (recommended for static sites)
No manual script needed
The CLI automatically injects the cside script and prefixes all your third-party scripts. If you use the CLI, skip to activating your domain. No need to add a script tag manually.
The CLI works with any framework that outputs static HTML files, including:
- Astro (static mode)
- Next.js (static export)
- Gatsby
- Nuxt (static mode)
- SvelteKit (static adapter)
- Eleventy (11ty)
- Hugo
- VitePress / VuePress
- Docusaurus
Any other framework that outputs static HTML files will also work. The CLI automatically detects .next and dist output folders, or you can specify a custom directory with --dir.
Install the CLI
Or run directly without installing:
Add to your build process
Add the CLI to your build script in package.json:
Replace example.com
Replace example.com with your actual domain configured in cside.
What the CLI does
When you run the CLI, it automatically:
- Injects the cside script into all HTML files
- Prefixes third-party script URLs with the cside proxy
- Adds
referrerpolicy="origin"to script tags for license verification
Common options
See the CLI Integration guide for all options.
Option 2: Manual script installation
Use this method for SSR applications or if you need more control over the integration.
The manual script runs in the browser's JavaScript engine, making it compatible with any framework or platform, regardless of your tech stack.
You can easily add our script tag to the document <head>. Make sure the <script> tag is the first script element that is added to the page.
Next steps
Once you've added cside to your website (via CLI or manual script), you'll see your script traffic in realtime on the dashboard.
Activate your domain: Go to Domains in the left sidebar and click the activate button next to your domain.
For optimal performance and Firefox compatibility, consider server-side prefixing if you're using the manual script method (the CLI handles this automatically).