Search

Search pages, services, tech stack, and blog posts

server.ts
client.ts
Elysia

Elysia BackendErgonomic Bun-native web framework

Elysia is built specifically for Bun — an end-to-end type-safe web framework with outstanding performance, a plugin ecosystem, and a declarative API that makes building APIs genuinely enjoyable.

Elysia is a Bun-native web framework built from the ground up for the Bun runtime. It delivers exceptional performance (consistently topping framework benchmarks), end-to-end type safety via TypeBox, and a plugin-based architecture that keeps code modular. At A Major, we use Elysia for high-performance API services where type safety and developer experience are equally important. Elysia's Eden Treaty client generates a fully typed API client from your server definition — no code generation step, no schema duplication. Combined with Bun's fast startup, built-in test runner, and npm compatibility, Elysia is our top pick for greenfield TypeScript APIs that need to be fast.

Quick start

bash
bun create elysia my-app
cd my-app
bun dev

Read the full documentation at elysiajs.com

Bun-native performance

Elysia on Bun consistently tops Node.js framework benchmarks — 2–3× faster than Express equivalents.

End-to-end type safety

Typed request/response schemas via TypeBox — validation, serialisation, and OpenAPI generation from the same definition.

Plugin architecture

Compose functionality with plugins — JWT, Swagger, CORS, rate limiting, and custom plugins all follow the same pattern.

Eden Treaty client

Type-safe API client generated from your Elysia server — share types between backend and frontend without code gen.

Lifecycle hooks

Global and per-route hooks for auth, logging, transformation, and error handling.

OpenAPI out of the box

Automatic Swagger UI and OpenAPI spec from your route definitions — no extra decorators.

Why it's hard

Bun runtime maturity

Bun is newer than Node.js and some npm packages with native bindings may not work. Testing compatibility early is critical for production projects.

Smaller ecosystem compared to Express

Elysia's plugin ecosystem is growing but significantly smaller than Express or Fastify. Custom middleware may need to be written from scratch.

Limited production case studies

Elysia is relatively new — fewer production war stories mean less community guidance for edge cases and scaling patterns.

Best practices

Use Eden Treaty for type-safe API clients

Eden Treaty generates a typed client from your Elysia server — share types across frontend and backend without code generation.

Leverage Elysia plugins for common concerns

Use official plugins for JWT, CORS, Swagger, and rate limiting instead of building custom middleware.

Structure routes with Elysia groups

Group related routes with shared middleware — auth, validation, and error handling scoped per group.

Use TypeBox for schema validation

TypeBox schemas validate requests at runtime while providing TypeScript types at compile time — single source of truth.

Frequently asked questions




Want to build with Elysia?

Talk to our engineering team about your Elysia architecture. We'll respond within 24 hours.

1 spot available in May 2026Apr 2026 fully booked

We limit intake each month so every project gets the focus it deserves.