Before: A Typical Express App
You probably have something like this:After: Same App + ATH (the diff)
Here’s what you add — your existing routes don’t change at all:routes/ath.ts — which is the ~70-line file from the tutorial.
Mapping Your Scopes
The most important decision: what scopes do you expose? Map them to what your API actually does:| Your API Route | HTTP Method | Suggested Scope |
|---|---|---|
/api/products | GET | products:read |
/api/cart | GET | cart:read |
/api/cart/add | POST | cart:write |
/api/orders | GET | orders:read |
/api/orders | POST | orders:write |
availableScopes array and discovery document:
How the Proxy Connects to Your API
The ATH proxy doesn’t replace your API — it sits in front of it and forwards authenticated requests: Your existing auth middleware on/api/* still works for browser users. The proxy handles agent auth separately.