Laravel / PHP Integration
1. Frontend
Option A: JavaScript / TypeScript
npm install @guardianstack/guardian-js// frontend/guardian.ts
import { loadAgent } from '@guardianstack/guardian-js';
// 1) Initialize once at app startup
const guardian = await loadAgent({
siteKey: 'site_XXXXXXXX',
});
// 2) Trigger an identification exactly where it matters (login, signup, checkout)
const res = await guardian.get();
// 3) Extract the requestId and send it to your backend for risk evaluation
const requestId = res?.requestId;Option B: Blade or plain PHP (no bundler)
2. Backend (Laravel / PHP)
Which signals should you gate on?
Plain PHP (no Laravel)
That's it
Last updated
Was this helpful?
