Quick start
Scaffold a new Elysia project withbun create:
Manual setup
Routing
Elysia uses a chainable API for defining routes:Schema validation
Elysia provides end-to-end type safety through itst schema validation module. Schemas are validated at runtime and inferred as TypeScript types automatically:
400 Bad Request with a descriptive error.
Middleware (lifecycle hooks)
Use Elysia’s lifecycle hooks to run code before or after route handlers:Plugins
Elysia has a plugin system for sharing routes, middleware, and state across your app:@elysiajs/bearer— Bearer token extraction@elysiajs/cors— CORS configuration@elysiajs/jwt— JWT authentication@elysiajs/swagger— OpenAPI / Swagger UI generation@elysiajs/trpc— tRPC adapter
bun add: