Skip to main content

Quickstart

Get up and running with Signal JS in minutes. This guide covers installation and basic usage.

Installation

Choose the package for your framework:

Vanilla JS / HTML / Vue.js

npm install @signal-js/browser
# or
pnpm add @signal-js/browser
# or
yarn add @signal-js/browser

React

npm install @signal-js/react

Next.js

npm install @signal-js/nextjs

Node.js Server

npm install @signal-js/node
Note: Framework packages (@signal-js/react, @signal-js/nextjs) automatically include the browser SDK (@signal-js/browser). You only need to install one package.

CDN

<!-- Full bundle with rrweb (recommended) -->
<script src="https://unpkg.com/@signal-js/browser/dist/signal-full.global.js"></script>

Basic Usage

Browser (NPM)

import { createSignal } from '@signal-js/browser';

const signal = createSignal({
  apiKey: 'your-api-key',
  projectId: 'your-project-id',
  // endpoint is optional (defaults to https://api.trysignal.ai/)
});

// Start recording
await signal.start();

// Identify a user
signal.identify('user-123', { 
  email: 'user@example.com', 
  name: 'John Doe' 
});

// Capture custom events
signal.capture('button_clicked', { buttonId: 'submit' });

Browser (CDN)

<script src="https://unpkg.com/@signal-js/browser/dist/signal-full.global.js"></script>
<script>
  const signal = SignalSDK.createSignal({
    apiKey: 'your-api-key',
    projectId: 'your-project-id',
    // endpoint is optional (defaults to https://api.trysignal.ai/)
  });
  
  // Start recording
  await signal.start();
  
  // Identify a user
  signal.identify('user-123', { email: 'user@example.com', name: 'John Doe' });
  
  // Capture custom events
  signal.capture('button_clicked', { buttonId: 'submit' });
</script>

Next Steps