Elysia is a TypeScript web server framework focused on ergonomics and end-to-end type safety. It targets Bun first but follows web standards so servers can run on other runtimes.
Overview
Elysia helps developers build HTTP APIs and realtime endpoints in TypeScript with inferred types from route handlers through validation and clients. The design emphasizes familiar patterns for routing, plugins, macros, and middleware while keeping request and response shapes checked by the compiler.
It advertises first-class support for common companion tools, including tRPC-style flows, OpenAPI and Swagger generation from types without extra annotation steps, and WebSocket handlers. Validation can plug in several schema libraries, and helpers exist for files, streaming responses, and Eden, a typed HTTP client aligned with server types.
Performance messaging centers on Bun, with benchmark comparisons against other server stacks, but maintainers state the framework is not locked to Bun and can run anywhere web-standard APIs are available.
For teams comparing Node-first frameworks, Elysia pitches unified typing across server, client, and tests so API changes surface as compile errors rather than silent contract drift.
Key features
- End-to-end TypeScript type safety
- HTTP routing and middleware plugins
- WebSocket support
- OpenAPI from TypeScript types
- Multiple schema library adapters
- Eden typed HTTP client
- Optimized for Bun runtime
- Web-standard portable runtime
Use cases
- Type-safe REST and JSON APIs
- Realtime WebSocket services
- Bun-backed web backends
- Auto-generated API documentation
- Discord bots and custom backends