Browser sensor
Install the drop-in script that collects client-side abuse signals.
The sensor is a small, dependency-free script that runs in your end-user's browser. It collects client-side signals that don't exist server-side — automation tells, behavioral timing, and device fingerprints — and is the client half of signal fusion.
Install
Add the script to the <head> of the page hosting your AI feature, configured with
your publishable site key:
<script async src="https://cdn.vectoral.cloud/v1/sensor.js?siteKey=pk_live_xxx&endpoint=https://api.vectoral.cloud/v1/sensor/collect"></script>
| Parameter | Required | Description |
|---|---|---|
siteKey |
yes | Your pk_live_ publishable key |
endpoint |
yes | The collect endpoint (/v1/sensor/collect) |
debug |
no | Set to 1 to log signals to the console |
The same settings can be given as data-site-key, data-endpoint, and
data-debug="true" attributes on the script tag. Without an endpoint, the sensor
returns a local placeholder token and never contacts Vectoral.
Collect before the protected action
The sensor only posts its signals when you call getToken() — loading the script
alone sends nothing. Call it right before the request that triggers your LLM call:
const token = await window.vectoral.getToken({ action: "generate" });
Fusion uses the most recent collect for the session within the last 5 minutes, so a
session that never called getToken() has no browser signal to fuse.
Forward the session id
For fusion to work, your backend score call must use the same session_id the
sensor generated. The sensor exposes it as window.vectoral.sessionId. Forward it on
the request that triggers your LLM call:
fetch("/api/generate", {
method: "POST",
headers: { "X-Vectoral-Session": window.vectoral.sessionId },
body: JSON.stringify({ /* ... */ }),
});
Your backend reads that header and passes it as session_id to
/v1/score.
What it collects
Automation tells
navigator.webdriver, ChromeDriver cdc_ properties, headless quirks,
missing window.chrome, and known automation globals (Playwright, Puppeteer,
Selenium, PhantomJS).
Behavior
Mouse movement and speed, clicks, keystrokes, scrolls, pointer types, and time to first interaction. Scripted sessions produce telltale shapes (no interaction, teleporting cursors).
Environment
User agent, languages, platform, hardware concurrency, timezone, canvas hash, and WebGL renderer — combined into a stable-ish fingerprint.
Token flow (optional gating)
/v1/sensor/collect returns a signed token and a soft decision. If you want a
real-time gate independent of /v1/score, attach that token to a protected request
and verify it server-side with /v1/sensor/verify.
For most integrations, the score path is enough — the browser
signal is fused automatically via request.sensor_token or session_id.