Adding our script
Choose how to integrate cside into your website. CLI for static sites, or manual script installation for dynamic applications.
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)
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.
Next steps
Once you’ve added cside to your website (via CLI or manual script), 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!