API Reference
BotShield provides two SDKs for integrating human presence verification:- Frontend SDK — Drop-in web component for your pages (
cdn.botshield.ai/sdk.js) - Backend SDK — TypeScript/Node.js library for server-side validation (
botshield-sdkon npm)
Get your API keys from the Partner Dashboard → Settings → API & Credentials.
Install
- Frontend (CDN)
- Backend (npm)
The Primary Output: Signal Strength
Every verification returns asignal_strength claim — a composite tier that reflects how confidently BotShield attests to this human on this device:
| Tier | API value | Typical use |
|---|---|---|
| New | newborn | First-time user — allow with enhanced monitoring |
| Stable | growing | Consistent presence — acceptable for most actions |
| Strong | strong | Long-standing verified user — most platforms allow |
| Trusted | trusted | Highest confidence — pre-cleared for high-value actions |
Authentication
All backend SDK calls use your API key in theAuthorization header:
| Key Type | Prefix | Purpose |
|---|---|---|
| Production | bs_prod_ | Live verification with real users |
| Test | bs_test_ | Development and testing |
SDK Methods
Core Verification
Create Session
Get an anchor grant token to start creating verification requests.
Create Verification Link
Generate a verification request with deep link, web URL, and QR code.
Verify Token
Validate a verification receipt JWT. Returns claims including
signal_strength.Check Status
Poll verification status. Returns signed token when complete.
Signal Pixel
Store Signal
Store a Signal Pixel bot score server-side. Returns a tamper-proof signal token.
Validate Signal
Validate a signal token to get the real server-side bot score. One-time use.
Partner Config
Get enabled integrations (Turnstile, etc.) for a site key.
Session Management
Revoke Verification
Cancel a pending verification. Use when create-verification-link returns 409.
Revoke Session
Invalidate an anchor grant token.
Typical Flow
Error Handling
| Code | Meaning |
|---|---|
200 | Success |
400 | Invalid or missing parameters |
401 | Invalid or expired token |
409 | Duplicate pending verification — use revokeVerification() first |
500 | Internal server error |
Next Steps
- Web Component Reference — Frontend SDK details,
BotShield.render()API - Signal Pixel — Passive bot scoring details
- Quick Start — Step-by-step integration walkthrough
- npm package — Backend SDK on npm