Elysia mounts any function of the shape (request: Request) => Response | Promise<Response>, which is what createTheAuthHandler from @glinr/theauth/http returns. So there is no Elysia package: you use the core handler directly.
Install
Mount the handler
app.mount(prefix, handler) strips the prefix before calling the handler, so pass basePath: "".
requireAgent is the same decision logic the Hono, Express and Fastify requireScope helpers use.
What was run
This snippet type checks under strict against Elysia 1.4 and was run with app.handle: GET /api/theauth/agents answered 200 with an authenticated caller, GET /docs without a token answered 401, and an unknown path under the mount answered 404. Last modified on October 19, 2026