@agentonboard/sdk/express exports requireAgentAccount(req, res, options) for Express applications. Because Express handlers write responses via res, the adapter accepts both req and res and writes 401, 403, or 500 responses directly when verification fails.
Copy-paste agent prompt
1. Install the SDK
- npm
- pnpm
- yarn
- bun
2. Guard your Express route
api/notes.ts
Why Express takes both
req and resExpress ignores a route handler’s return value. Passing res into requireAgentAccount ensures 401, 403, and 500 JSON responses are sent before the promise resolves, so handlers only need if (!session.ok) return;.3. Test with curl
Mint a 5-minute test token usingPOST /api/v1/token/exchange and call your Express route: