Elysia.js
TypeScript-first web framework optimized for Bun runtime. Focuses on end-to-end type safety, performance (among the fastest Node.js/Bun frameworks), and ergonomics. Built-in OpenAPI documentation generation, Eden Treaty client for type-safe API calls, and schema validation via TypeBox. Inspired by tRPC but for REST APIs.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
TypeBox schema validation provides input validation security. CORS configured via plugin. No built-in rate limiting — implement via middleware.
⚡ Reliability
Best When
Building TypeScript Bun-based API services where end-to-end type safety and OpenAPI auto-generation matter.
Avoid When
Node.js-only environments or teams preferring Express/Fastify's mature ecosystem.
Use Cases
- • Build high-performance REST APIs in TypeScript/Bun with automatic OpenAPI documentation generation
- • Implement type-safe API servers where Eden Treaty provides a type-safe client matching server routes
- • Create modular API services with Elysia's plugin system for reusable route groups and middleware
- • Build Bun-based microservices that benefit from Bun's faster startup time and native TypeScript support
- • Replace Express/Fastify with a type-safe, ergonomic API framework in Bun-first projects
Not For
- • Node.js-primary projects — Elysia is optimized for Bun; performance benefits are reduced on Node.js
- • Teams unfamiliar with TypeScript type gymnastics — Elysia's type system is advanced; complex generics can be confusing
- • Projects requiring mature ecosystem — Elysia is newer and has fewer plugins than Express/Fastify
Interface
Authentication
Framework — auth via middleware. No built-in auth, but jwt and session plugins available.
Pricing
MIT licensed open source framework.
Agent Metadata
Known Gotchas
- ⚠ Elysia is optimized for Bun — performance on Node.js is good but not the primary target; use Hono for Node.js-first projects
- ⚠ Eden Treaty client requires exact type matching — changing server types without updating client breaks type safety; regenerate or use strict TypeScript
- ⚠ Plugin order matters — lifecycle hooks (onBeforeHandle, onError) register in plugin order; incorrect ordering causes middleware to skip
- ⚠ TypeBox schema is required for validation — Elysia doesn't use Zod by default; switch requires @elysiajs/zod or TypeBox compatibility
- ⚠ Elysia 1.0 changed the API significantly from 0.7 — older tutorials may use different method names and plugin patterns
- ⚠ Context (ctx) is shared via reference in lifecycle hooks — mutating ctx.body in middleware changes what handlers receive; use immutable patterns when possible
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Elysia.js.
Scores are editorial opinions as of 2026-03-06.