Skip to main content
Start With Integrations For Faster SetupIf you want a recipe-backed path for a specific platform, start with the Integrations guides. The SDK is best when you want direct control inside your own middleware or handler code.

Installation

Basic Usage

Configuration

API Methods

checkMitigation(request)

Check if a request should be mitigated.

verifyChallenge(token, response)

Verify a user’s response to a challenge.

sendBeaconEvent(event)

Send request traffic to the beacon server so Esper can analyze it and update state for later mitigation checks.

getUsage()

Get API usage statistics.

Framework Integration

Express Middleware

Next.js API Routes

Fastify Plugin

Browser Usage

The SDK can be used in browser environments for client-side protection:

Error Handling

TypeScript Support

The SDK includes full TypeScript definitions:

Testing

Examples

Full examples are available in the GitHub repository.