Skip to content
Curved text logo saying 'Elysia JS'

Ergonomic Framework for Humans

TypeScript with End-to-End Type Safety, type integrity, and exceptional developer experience. Supercharged by Bun.

Get Started
bun create elysia app

See why developers love Elysia

The first production ready,
and most loved Bun framework

Our Principle

Design for Human

Our goal is to designed an ergonomic, sensible and productive framework that even beginners can use easily

Design to avoid unnecessary complexity, and type complexity for you to focus on building

A framework that feel just like JavaScript

typescript
import { Elysia } from 'elysia'

new Elysia()
	.get('/', 'Hello World')
	.get('/image', Bun.file('mika.webp'))
	.get('/stream', function* () {
		yield 'Hello'
		yield 'World'
	})
	.ws('/realtime', {
		message(ws, message) {
			ws.send('got:' + message)
		}
	})
	.listen(3000)

Just Return

A string, number or complex JSON

All we need to do is just return

File built-in

To send a file or image, just return

Nothing more or nothing less

Stream response

Use yield to stream response

All we need to do is just return

Data in realtime

With µWebSocket built-in

Send live data in just 3 lines

The Next Level of Type Safety

typescript
import { 
Elysia
} from 'elysia'
new
Elysia
()
.
get
('/id/:id', ({
params
,
set
}) => {
set
.
headers
.a
return 'Su' }) .
get
('/optional/:name?', ({
params
: {
name
} }) => {
return
name
?? 'Pardofelis'
}) .
listen
(3000)

Your own documentation in 1 line

It's not magic

With deep integration with OpenAPI schema
Elysia can generate Swagger documentation for your API out of the box

Scalar documentation generated by Elysia using Elysia Swagger plugin
typescript
import { Elysia } from 'elysia'
import swagger from '@elysiajs/swagger'

new Elysia()
	.use(swagger())
	.use(character)
	.use(auth)
	.listen(3000)

11.88ms

POST /character/:id/chat

Playback

Request
Validation
Transaction
Upload
Sync
For DevOps

OpenTelemetry

Elysia has 1st party support for OpenTelemetry. Instrumentation is built-in, so you can easily monitor your services on regardless of the platform.

typescript
import { 
treaty
} from '@elysiajs/eden'
import type {
App
} from './server'
const
api
=
treaty
<
App
>('api.elysiajs.com')
const {
data
} = await
api
.
profile
.
patch
({
age
: 21
})
For Frontend

End-to-end Type Safety

Like tRPC, Elysia provides type-safety from the backend to the frontend without code generation. Interaction between frontend and backend is type-checked at compile time.

21x

faster than Express

6x

faster than Fastify

  1. Elysia Bun
    2,454,631 reqs/s
  2. Gin Go

    676,019

  3. Spring Java

    506,087

  4. Fastify Node

    415,600

  5. Express Node

    113,117

  6. Nest Node

    105,064

Measure in requests/second. Result from TechEmpower Benchmark Round 22 (2023-10-17) in PlainText

Test with confidence

Type safe with auto-completion

Elysia provide a type-safe layer for interact and test your server from routes to parameters.

With auto-completion, you can easily write tests for server without any hassle.

typescript
import { 
treaty
} from '@elysiajs/eden'
import {
app
} from './index'
import {
test
,
expect
} from 'bun:test'
const
server
=
treaty
(
app
)
test
('should handle duplicated user', async () => {
const {
error
} = await
server
.
user
.
put
({
Argument of type '{ username: string; }' is not assignable to parameter of type '{ username: string; password: string; }'. Property 'password' is missing in type '{ username: string; }' but required in type '{ username: string; password: string; }'.
username
: 'mika',
})
expect
(
error
?.
value
).
toEqual
({
success
: false,
message
: 'Username already taken'
}) })

Powered by love
from the community

Made possible by you

Elysia is not own by an organization but is driven by the community.
Elysia development is only possible thanks to your support

Thank you for making Elysia possible

To summarize
Only the best
for the bold

For builders, inventors, and visionaries
We spent years studying the strengths and weaknesses of JavaScript frameworks, all to deliver an exceptional experience

At the speed of light

Up to 21x faster than Express

Supercharged by Bun,

Elysia is one of top performing JavaScript frameworks

Maximum Type Safety

Dynamic type safety

Built from type to runtime

Elysia learn from your codebase, adapt, enforce with your type

Productive in a reach

The best experience of today

Ergonomically designed for human, putting DX at the priority. No technical non-sense

These are the pillars we built Elysia upon,
to deliver the best experience yet

Build the future,
together

Get startedTutorial

Built with 💖 for