Documentation / Concepts
Inert by default. Explicit on start.
The collector is a reviewed ES module served as /trace.js. Importing it touches nothing; collection starts only when your consent flow calls start with the literal consent value.
Last updated
The lifecycle
import { createSiteCollector } from 'https://app.volance.com/trace.js';
const collector = createSiteCollector({ fingerprints: false });
collector.start({ consent: true }); // idempotent; literal consent required
const evidence = collector.stop(); // { clientSignals, events }
- Inert construction. Import and construction set no listeners, timers, network calls, or storage.
- Bounded collection. At most 256 events and 10 minutes per run.
- Clean stop. Listeners are capture-phase and removed on stop; the snapshot is returned and state is cleared.
What it captures, and what it never reads
| Captured | Examples | Never captured |
|---|---|---|
| Event type and timing | pointerdown, keydown, scroll, elapsed ms | Key identities, characters, input values |
| Pointer and touch | Coordinates, deltas, pressure, wheel distance | Element text or identity; page URLs |
| Keyboard cadence | Count, dwell and flight timing | Which keys were pressed; clipboard contents |
| Coarse environment | Display size, device class, platform, timezone | Page content; cross-site identifiers |
The fingerprint tier
The fingerprint tier — WebGL renderer, canvas probe, installed-font count — is real fingerprinting. It runs only when the integrating site passes { fingerprints: true }, and the server drops the fields unless the workspace setting is enabled. Default: off.
Consent is your flow
The collector does not render a banner or infer consent from a click. start({ consent: true }) is a signal from your application that your consent flow has completed. If consent is withdrawn, call stop() and discard the snapshot. The data page covers retention and the notice.
Allowed origins and the relay
Allowed origins are configured per project. When the list is non-empty, a browser-originated manifest request from a different Origin is refused with 403. Server-to-server calls are not origin-gated. That keeps the public key from being reused on a site you do not control, but it does not replace the secret-key boundary.
The collector has no network or credential code. It hands evidence to your page, your page sends it to your same-origin relay, and the relay calls POST /api/trace/score with sk_. Never send browser telemetry directly to a secret-authenticated endpoint.
SPAs and CSP
- SPA routes: start when the interaction you care about begins and stop on submit. A collector left running across a long session hits the 10-minute cap.
- CSP: if you set
script-src, allowhttps://app.volance.com. A blocked module fails in the console. - Pinning:
/trace.jsis a short-cache alias. Content-hashed copies are immutable if you need an exact version. - Blockers: an ad blocker can prevent the module from loading. Your backend must handle missing or partial evidence.
What it cannot see
A client that never runs JavaScript is never measured by a page collector. That is the boundary of the surface, not a bug to tune around. For non-JS and server-to-server traffic, score the request at your edge instead. The score endpoint accepts requestSignals for exactly that case.
Related
- Quickstart — install the collector and score
- Data & privacy — retention and the notice
- Session manifest — the server half of collection
- Quickstart — install it and score one session