Quickstart Integration
Integrate AuthShield client-side agent to generate high-entropy device hashes and stream telemetry to your verification backend in under 3 minutes.
1. Client-Side Script Injection
<script>
const authShield = import('https://cdn.authshield.io/agent/v4')
.then(Agent => Agent.load({ apiKey: "pub_live_98a7b6c5d4" }));
authShield.then(fp => fp.get()).then(result => {
console.log("Visitor ID:", result.visitorId);
console.log("Telemetry Event Token:", result.requestId);
});
</script>
2. Backend Verification (Node.js Example)
const { AuthShieldClient } = require('@authshield/server-api');
const client = new AuthShieldClient({ secretKey: process.env.AUTHSHIELD_SECRET_KEY });
app.post('/api/login', async (req, res) => {
const { requestId } = req.body;
const event = await client.getEvent(requestId);
if (event.bot.detected || event.suspectScore > 65) {
return res.status(403).json({ error: "High risk environment detected." });
}
// Proceed with authentication...
});