Skip to content

Installation

ChatCops consists of three packages. Install only what you need.

The simplest way — no build step required:

<script
src="https://cdn.jsdelivr.net/npm/@chatcops/widget/dist/chatcops.min.js"
data-api-url="https://your-api.com/chat"
></script>

For bundler-based projects (Vite, webpack, Next.js):

Terminal window
npm install @chatcops/widget
import { ChatCops } from '@chatcops/widget';
ChatCops.init({
apiUrl: 'https://your-api.com/chat',
theme: { accent: '#6366f1' },
branding: { name: 'My Assistant' },
});
Terminal window
npm install @chatcops/server

The server package includes adapters for Express, Vercel, and Cloudflare Workers:

// Express
import { chatcopsMiddleware } from '@chatcops/server';
// Vercel Edge
import { chatcopsVercelHandler } from '@chatcops/server';
// Cloudflare Workers
import { chatcopsCloudflareHandler } from '@chatcops/server';

Only needed if building custom integrations:

Terminal window
npm install @chatcops/core

Provides direct access to providers, tools, knowledge base, and i18n:

import { createProvider } from '@chatcops/core';
import { LeadCaptureTool } from '@chatcops/core/tools';
import { FAQKnowledgeSource } from '@chatcops/core/knowledge';
  • Widget: Any modern browser (Chrome, Firefox, Safari, Edge)
  • Server: Node.js 22+ (Express), or edge runtime (Vercel/Cloudflare)
  • TypeScript: Full type definitions included in all packages