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.
// install
npm install @cloaktrace/browserimport { CloakTrace } from "@cloaktrace/browser";
const ct = CloakTrace.init({ key: "pk_live_xxx" });<!-- served from the CloakTrace CDN, no build step -->
<script src="https://cdn.cloaktrace.ai/v1/ct.js" data-key="pk_live_xxx" defer></script>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.
// your server, at login / signup / checkout
const intelligence = await cloaktrace.identify(token);3. Read the intelligence and decide
{
"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 }
}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.