Quickstart

Stop fraud in under 10 minutes with Guardian's comprehensive fraud detection platform.

Guardian Stack is a fraud detection platform that helps businesses protect their applications from bots, account takeover, VPN abuse, browser tampering, and sophisticated fraud attempts. Guardian Stack capabilities include:

1

Real-time fraud detection

Identify bots, VPNs, incognito browsing, and browser tampering with enterprise-grade accuracy.

2

Risk assessment

Get actionable fraud signals and confidence scores for every visitor interaction.

3

Developer-friendly

Simple 3-line integration that works with any stack.

1. Get your API keys

Sign up for Guardian Stack to get your site key and secret key.

  • Copy your Site Key (for client-side integration)

  • Copy your Secret Key (for server-side event retrieval)

2. Add the client-side agent

Install the Guardian JS SDK to collect fraud signals from browsers:

npm install @guardianstack/guardian-js
# or
yarn add @guardianstack/guardian-js

Usage:

import { loadAgent } from '@guardianstack/guardian-js';

// Initialize the agent once when your app starts
const guardian = await loadAgent({ 
  siteKey: 'YOUR_SITE_KEY' 
});

// Call .get() when you need fraud protection (login, signup, payment, etc.)
// Don't call on every page load - only for critical user actions
const response = await guardian.get();

const requestId = response?.requestId;

// Send requestId to your server for fraud analysis
// Your backend will use this ID to get the full fraud assessment

3. Get fraud signals on your server

Install the server SDK to analyze fraud signals:

You can also call the Guardian Stack API directly from your backend without using the server SDK:

Make sure to replace YOUR_EVENT_ID and YOUR_GUARDIAN_SECRET_KEY.

Example response:

4. Make fraud decisions

Use the fraud signals to protect your application:

🎉 You're protected!

Congratulations! You now have enterprise-grade fraud detection running in your application. Here's what you've accomplished:

✅ Real-time fraud detection - Your app now identifies bots, VPNs, and suspicious behavior

✅ Risk-based decisions - You can block, challenge, or allow users based on fraud signals

✅ Production-ready - Your integration is secure and scales with your traffic

Last updated

Was this helpful?