Adding our script
Choose how to integrate cside into your website. CLI for static sites, or manual script installation for dynamic applications.
Choose the installation method that fits your site. Pinned SRI installation is available only for teams where cside has enabled it.
| Method | Best for |
|---|---|
| CLI tool | Static sites (SSG), zero-code integration |
| Manual script | SSR applications, custom setups |
| Pinned SRI | Fixed script bytes with manual updates (selected teams) |
Option 1: CLI tool (recommended for static sites)
The CLI automatically injects the cside monitoring script into your HTML files. If you use the CLI, there is no script tag to add 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
npm install @cside.dev/cli
Or run directly without installing:
npx @cside.dev/cli@latest
Add to your build process
Add the CLI to your build script in package.json:
{
"scripts": {
"build": "your-build-command && npx @cside.dev/cli@latest"
}
}
What the CLI does
When you run the CLI, it automatically:
- Removes any existing cside script tag, so re-running it after each build never adds a duplicate
- Injects the cside script as the first script in all HTML files, skipping
node_modulesandvendor - Adds
referrerpolicy="origin"to the script tag for license verification
Common options
# Process a specific directory
npx @cside.dev/cli --dir ./out
# Inject a team-scoped script host (recommended)
npx @cside.dev/cli@latest --team-id [your-team-id]
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 add our script tag to the document <head>. Make sure the <script> tag is the first script element that is added to the page. Replace [your-team-id] with the team ID shown under Team Settings > General.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://[your-team-id].csidetm.com/client.js" referrerpolicy="origin"></script>
...
</head>
<body>
...
</body>
</html>If you’re using Next.js, you can make use of our @cside.dev/next npm package. Just install it like this:
Install our Script
# With NPM
npm install @cside.dev/next# With Yarn
yarn add @cside.dev/next# With PNPM
pnpm add @cside.dev/nextAdd our Script
After installing, add the following to your _document file in your NextJS project. Pass your team ID (from Team Settings > General) as teamId; without it the component loads the shared proxy.csidetm.com host.
// pages/_document.tsx
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { CSideScript } from '@cside.dev/next';
export default function Document() {
return (
<Html lang="en">
<Head>
<CSideScript teamId="[your-team-id]" /> {/* <- Here */}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}or if you’re using App router:
// layout.tsx
import { CSideScript } from '@cside.dev/next';
export default function Layout({ children }) {
return (
<>
<CSideScript teamId="[your-team-id]" /> {/* <- Here */}
{children}
</>
);
}See the Next.js integration guide for all CSideScript props.
Go to Webflow
First, go to the Webflow Dashboard and navigate to the 3 dots menu and select “Settings”. Then navigate to “Custom code”.
Add cside’s Script
In the “Custom code” section, add the following to the top of your “Head Code” section.
<!-- cside script -->
<script src="https://[your-team-id].csidetm.com/client.js" referrerpolicy="origin"></script>
<!-- the rest of your head code/scripts -->Save, Deploy, and Relax!
Click “Save” and you’re done. You can now see your website’s script traffic monitored in real-time on the dashboard.
Option 3: Pinned script with Subresource Integrity (SRI)
Pinned installation is enabled by cside staff on a per-team basis. If you don’t see this option in your dashboard, use the manual script installation above.
If pinned scripts are available for your team, you can install a fixed version of the cside script with a Subresource Integrity (SRI) hash, so the browser verifies the exact script bytes before running it. The filename is the SHA-256 hash of the complete script, including your team’s configuration. Publishing a new configuration or script version gets a new URL; existing pinned URLs keep working.
Open Setup > Security in the dashboard and copy the complete script tag under Latest published version. Place it synchronously near the beginning of <head>, before other scripts, keeping the URL and integrity value from the same publication:
<script
src="https://[your-team-id].csidetm.com/[sha256].js"
integrity="sha384-[base64-digest]"
crossorigin="anonymous"
referrerpolicy="origin"
></script>
The displayed version is always the latest published one. It doesn’t indicate which version is installed on your site. If the script is still preparing, return to this page and select Refresh; this checks for the publication and doesn’t rebuild the script. Settings changes can take time to appear in a new publication.
A pinned script keeps its original code and settings. To pick up new settings or script fixes, replace the complete tag with the latest one. Turning Developer Mode on or off also requires replacing or removing an already pinned script, and old pinned URLs keep working even if pinned installation is later disabled for your team.
If a publication fails to load, use Retry.
Next steps
Once you’ve added cside to your website , you’ll see your script traffic in real-time on the dashboard.
Verify it is working: Open the dashboard and open Health in the left sidebar. Script traffic appears within seconds of your first page view. There is no activation step. Your domains are listed on the team Home page and under Team Settings > Domains.
If you use Claude Code, Cursor, or a similar tool, you can add cside with a single prompt instead of following the steps above.
Thanks for your feedback!