Client Libraries
BotShield provides official client libraries as an alternative to calling the REST API directly. Each library wraps the same Census verification operations and provides typed interfaces, automatic retries, and error handling out of the box.Client libraries require an API key. Request developer access to get started.
Available SDKs
TypeScript / JavaScript
Server-side TypeScript and JavaScript SDK. Works with Node.js, Deno, Bun, Cloudflare Workers, and Vercel Edge Runtime.
More Languages Coming
Additional SDKs (Python, Go, etc.) are planned. Contact us if you have a specific language requirement.
TypeScript / JavaScript
The TypeScript SDK is published on npm and generated with Stainless for full type safety and consistency with the REST API.Installation
Quick Start
Census is anonymous. You do not pass a user email or auth mode — there is no identity-bearing parameter and none is returned. Correlate results back to your own user via the
metadata you supply and the request_id you receive.Validating a Verification Token
The synchronousverification_token (delivered on your return_url or polled via status) is a PII-free signed receipt. Validate it with verifyToken:
Error Handling
Automatic Retries
The SDK automatically retries failed requests up to 2 times with exponential backoff. Connection errors, timeouts, 429 rate limits, and 5xx server errors are all retried by default.Supported Runtimes
- Node.js 20 LTS or later
- Deno v1.28.0+
- Bun 1.0+
- Cloudflare Workers
- Vercel Edge Runtime
Resources
- GitHub Repository — Source code, issues, and releases
- Full API Reference — Complete method documentation
- npm Package — Latest published version
- Changelog — Release history
REST API vs. Client Library
Both approaches use the same underlying API and provide the same guarantees. Choose what fits your stack:Next Steps
- REST API Reference — Direct HTTP endpoint documentation
- Quick Start — Step-by-step integration walkthrough
- SDK Features — What Census provides