Quickstart

From zero to your first risk score.

Three steps: install the SDK (npm package or script tag), send a session token from your server, and read the intelligence. You keep the decision inside your own application.

1. Install the browser SDK

Install however your stack prefers, both load the collector from a global CDN with near-zero latency. Use the npm package if you have a build step, or drop the script tag on any page with no build step at all.

Shell
// install
npm install @cloaktrace/browser
JavaScript
import { CloakTrace } from "@cloaktrace/browser";
const ct = CloakTrace.init({ key: "pk_live_xxx" });

2. Send the session from your server

The script produces a short-lived token. Exchange it server-side so the decision never lives in the browser. Resolution returns in under a millisecond.

JavaScript
// your server, at login / signup / checkout
const intelligence = await cloaktrace.identify(token);

3. Read the intelligence and decide

JSON
{
  "device":  { "id": "dev_9c02be", "confidence": 0.96 },
  "actor":   { "human": 0.07, "automation": 0.28, "ai_agent": 0.62 },
  "network": { "residential_proxy_probability": 0.71 },
  "risk":    { "score": 0.78 }
}
JavaScript
if (intelligence.risk.score > 0.70) return review();

That is the whole loop. See the API reference for the full response schema, or read how the agents turn signals into an answer.