Skip to main content

Vue / Vanilla JS / Browser Integration

Use @signal-js/browser with Vue, Vanilla JS, Svelte, Angular, or any JavaScript framework. The same createSignal() API runs in any browser environment. No framework-specific package is required.

Quick start

  1. Installnpm install @signal-js/browser
  2. Initialize — Call createSignal({ endpoint, apiKey, projectId }) and then await signal.start(). See Initialization.
  3. Track events — Use signal.capture(eventName, properties). See Capture.
  4. Identify users — Use signal.identify(distinctId, traits). See Identify.

Sub-pages

Best practices

  1. Initialize once — Create the Signal instance once at app entry.
  2. Use composables (Vue) — A useSignal() composable keeps the API in one place.
  3. Track route changes — Use Vue Router (or your framework’s router) to send $pageview on navigation when needed.
  4. Use addTracingHeaders only when needed — Enable only if you use Node integration and want server correlation.
  5. Use environment variables — Store endpoint, apiKey, projectId in .env (e.g. VITE_* for Vite).
  6. Use sessionRecordingMasking — Add signal-no-capture, signal-mask, or signal-ignore-input to sensitive UI.