Skip to main content
Each framework binding reads the Authorization header, verifies the RS256 token against AgentOnboard’s public JWKS, calls your account resolver, and maps failures to HTTP 401, 403, or 500 responses.

Choose your framework

Next.js

Express

Hono

FastAPI

Django

Flask


Shared adapter guarantees

All @agentonboard/sdk framework bindings enforce the same rules: Key properties across all bindings:
  • Header-only extraction: A Bearer prefix is stripped case-insensitively.
  • Hardcoded Domain: audience and issuer come from your server code, never from the incoming request.
  • Minimal resolver input: resolveAccount receives { email } alone.
  • No account caching: resolveAccount runs once per request so deleted or suspended users are blocked immediately.
  • Consistent HTTP statuses: Token verification failures return 401. ACCOUNT_REQUIRED returns 403. Unhandled resolver errors return 500.

Custom failure responses (onFailure)

In TypeScript bindings (next, express, hono), pass onFailure to customize the error response body or headers. It receives { code, error } and must return a standard Web Response:
Return a Web Response from onFailureonFailure takes one argument ({ code, error }) and must return a Web Response object, including in the Express adapter which copies the status, headers, and body onto res.

Supplying custom or offline JWKS keys

For unit tests, air-gapped environments, or custom fetchJwks proxies, call verifyAgentAccount from @agentonboard/sdk directly:

Errors & Status Codes

Testing & Production