autumnHandler creates server-side endpoints that handle communication between your frontend React hooks and Autumn’s API. It manages customer authentication and proxies requests securely using your secret key.
Framework adapters
Import the handler from the adapter that matches your backend framework:| Framework | Import path |
|---|---|
| Next.js | autumn-js/next |
| Hono | autumn-js/hono |
| Elysia / Web Standard | autumn-js/fetch |
| Express | autumn-js/express |
| Other | autumn-js/backend |
autumn-js/fetch) works with any runtime that uses the Fetch API Request/Response objects, including Elysia, Cloudflare Workers, and Deno.
The Express adapter requires
express.json() body-parser middleware before the Autumn handler. See the setup guide for full examples.Usage
Parameters
Function that receives the incoming request and returns customer identification data.
Autumn API secret key. Defaults to
AUTUMN_SECRET_KEY environment variable.Override the Autumn API URL. Use when self-hosting.
Path prefix for routes. Defaults to
/api/autumn.If true, suppresses console warnings and logs.

