Skip to main content
Installation
Language

Vite Integration

Integrate cside with your Vite application using the @cside.dev/vite plugin.

Installation

Install the cside Vite plugin:

npm i @cside.dev/vite

Setup

Add the cside plugin to your vite.config.js or vite.config.ts:

// vite.config.ts
import { defineConfig } from "vite";
import cside from "@cside.dev/vite";

export default defineConfig({
	plugins: [cside()],
});

Configuration Options

The plugin accepts the following configuration options:

  • teamId (optional) - Your cside team ID. The script is loaded from a team-scoped host (https://{teamId}.csidetm.com/script.js) instead of the default host.
  • fingerprint (optional, default false) - Load the fingerprinting script instead of the default monitoring script.
  • enabled (optional) - Whether the plugin injects the script. Defaults to enabled for production builds only.

Example with all options:

// vite.config.ts
import { defineConfig } from "vite";
import cside from "@cside.dev/vite";

export default defineConfig({
	plugins: [
		cside({
			teamId: "345678765434567890",
			fingerprint: false,
			enabled: true,
		}),
	],
});
Was this page helpful?