Visitor Identification
Accurately identify visitors on your website to prevent fraud, account takeovers, and abuse.
How It Works
Integration Guide
1. Client-Side: Generate a Request ID
npm install @guardianstack/guardian-jsimport { loadAgent } from "@guardianstack/guardian-js";
// 1. Initialize the agent (usually on app load)
const agentPromise = loadAgent({
siteKey: "YOUR_PUBLIC_SITE_KEY",
});
// 2. Call this function when a user performs an action
async function getIdentificationToken() {
const agent = await agentPromise;
// Collect signals and send to Guardian API
const response = await agent.get();
const result = await response.json();
// Returns a unique requestId for this specific event
return result.requestId;
}2. Server-Side: Retrieve the Visitor ID
Understanding the Visitor ID
Stability & Accuracy
Site-Scoped Privacy
Best Practices
Linking to User Data
Column
Type
Description
Caching
Last updated
Was this helpful?
