Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elysiajs/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Elysia is an ergonomic web framework for building backend servers with TypeScript. Designed with simplicity and type safety in mind, Elysia offers automatic type inference, a composable plugin system, and blazing-fast performance — all optimized for Bun while supporting Node.js, Deno, Cloudflare Workers, and more.

Quick Start

Get a working Elysia server running in under 5 minutes on Bun or Node.js.

At a Glance

See Elysia’s core features — type inference, validation, OpenAPI, and Eden.

Essential Concepts

Learn routing, handlers, validation, lifecycle hooks, and plugins.

Eden Client

Use Elysia’s type-safe HTTP client with no code generation required.

Why Elysia?

Elysia combines the developer experience of a modern framework with the performance of a low-level runtime. It infers TypeScript types from your route definitions automatically — no decorators, no manual type annotations, no code generation.

End-to-end type safety

Types flow from server routes to client calls via Eden, similar to tRPC but without the abstraction.

Standard Schema support

Use Zod, Valibot, ArkType, or Effect Schema alongside Elysia’s built-in TypeBox validator.

Plugin system

Compose reusable functionality with full lifecycle encapsulation and type propagation.

OpenAPI built-in

Generate accurate API documentation automatically from your TypeScript types and schemas.

Get started

1

Install Bun

Elysia is optimized for Bun. Install it with a single command.
curl -fsSL https://bun.sh/install | bash
2

Create a new project

Scaffold a new Elysia project using the official template.
bun create elysia my-app
cd my-app
3

Start the dev server

Run the development server with hot reload.
bun dev
Your server is now running at http://localhost:3000.
4

Write your first route

Open src/index.ts and add a route with full type safety.
import { Elysia, t } from 'elysia'

new Elysia()
  .get('/hello/:name', ({ params: { name } }) => `Hello, ${name}!`, {
    params: t.Object({ name: t.String() })
  })
  .listen(3000)

Explore the ecosystem

Official plugins

CORS, JWT, static files, HTML, cron, OpenTelemetry, and more.

Runtime integrations

Deploy to Node.js, Cloudflare Workers, Vercel, Deno, Next.js, Astro, and SvelteKit.

Patterns & best practices

Macros, WebSockets, error handling, cookies, testing, and deployment guides.

Tool integrations

Connect with Drizzle, Prisma, Better Auth, and the Vercel AI SDK.

Build docs developers (and LLMs) love