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

PageDescription
InitializationInstall, Vue setup, Vanilla JS, other frameworks
CaptureTrack custom events with signal.capture()
IdentifyIdentify users with signal.identify()
Set person propertiesUpdate user properties with setPersonProperties, setPersonPropertiesOnce
GroupAssociate users with groups with signal.group()
Super propertiesRegister properties included with every event (register, registerOnce, unregister)
AliasLink aliases to users with signal.alias()
Recording controlControl recording with start, stop, pauseRecording, resumeRecording, flush, dispose
Opt-outControl user opt-out with optOut, optIn, hasOptedOut
Page viewsTrack page views with Vue Router or manually
ComposableReusable useSignal() composable for Vue
ConfigurationcreateSignal() options

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.