{/* How to access the Auth object */}
The Auth object is available on the request object in server contexts. Some frameworks provide a helper that returns the Auth object. See the following table for more information.
| Framework | How to access the Auth object |
|---|---|
| Next.js App Router | auth() |
| Next.js Pages Router | getAuth() |
| Astro | locals.auth() |
| Express | req.auth |
| Fastify | getAuth() |
| Hono | getAuth() |
| Nuxt | event.context.auth() |
| React Router | getAuth() |
| TanStack React Start | auth() |
| Other | request.auth |