Vue / Vanilla JS / Browser Integration
Use @signal-js/browser with Vue, Vanilla JS, Svelte, Angular, or any JavaScript framework. The samecreateSignal() API runs in any browser environment. No framework-specific package is required.
Quick start
- Install —
npm install @signal-js/browser - Initialize — Call
createSignal({ endpoint, apiKey, projectId })and thenawait signal.start(). See Initialization. - Track events — Use
signal.capture(eventName, properties). See Capture. - Identify users — Use
signal.identify(distinctId, traits). See Identify.
Sub-pages
| Page | Description |
|---|---|
| Initialization | Install, Vue setup, Vanilla JS, other frameworks |
| Capture | Track custom events with signal.capture() |
| Identify | Identify users with signal.identify() |
| Set person properties | Update user properties with setPersonProperties, setPersonPropertiesOnce |
| Group | Associate users with groups with signal.group() |
| Super properties | Register properties included with every event (register, registerOnce, unregister) |
| Alias | Link aliases to users with signal.alias() |
| Recording control | Control recording with start, stop, pauseRecording, resumeRecording, flush, dispose |
| Opt-out | Control user opt-out with optOut, optIn, hasOptedOut |
| Page views | Track page views with Vue Router or manually |
| Composable | Reusable useSignal() composable for Vue |
| Configuration | createSignal() options |
Best practices
- Initialize once — Create the Signal instance once at app entry.
- Use composables (Vue) — A
useSignal()composable keeps the API in one place. - Track route changes — Use Vue Router (or your framework’s router) to send
$pageviewon navigation when needed. - Use addTracingHeaders only when needed — Enable only if you use Node integration and want server correlation.
- Use environment variables — Store endpoint, apiKey, projectId in
.env(e.g.VITE_*for Vite). - Use sessionRecordingMasking — Add
signal-no-capture,signal-mask, orsignal-ignore-inputto sensitive UI.
