Authentication
Acme handles authentication via short-lived JWTs signed by your workspace's private key. The SDK ships with helpers for the common flows: cookie-session web apps, mobile clients, and machine-to-machine calls.
Verifying a request
Every handler receives a typed ctx.actor after the auth middleware
runs. The middleware is on by default — opt out per route with
auth: false.
Cookie sessions
For browser-based clients, set the session cookie after sign-in:
The cookie is HttpOnly, Secure, and SameSite=Lax by default.
Override only if you have a documented reason.
Machine-to-machine
For server-side calls, mint a service token:
The token is printed once. Treat it like a password — store it in your secrets manager, not in source control.
Role-based access
Define roles in acme.config.ts:
Then gate handlers: