A fast, end-to-end type-safe backend framework for TypeScript. Build APIs with built-in validation, real-time subscriptions, and automatic client generation without the overhead.
bun add hedystiaimport Hedystia, { h } from 'hedystia'
// Hover over `params` to see inferred types!
const app = new Hedystia()
.get(
'/users/:id',
({ params }) => {
return {
id: params.id,
name: 'Jane Doe'
}
},
{
params: h.object({
id: h.number().coerce()
})
}
)
.listen(3000)Your server schemas are perfectly mirrored to the client. Real-time updates with zero code generation delays.
import Hedystia, { h } from 'hedystia'
export const app = new Hedystia()
.post(
'/users',
({ body }) => {
return {
id: 1,
name: body.name
}
},
{
body: h.object({
name: h.string()
}),
response: h.object({
id: h.number(),
name: h.string()
})
}
)
.listen(3000)
export type App = typeof appimport { createClient } from '@hedystia/client'
import type { App } from './backend'
const client = createClient<App>('http://localhost:3000')
const { data, error } = await client.users.post({
body: { name: 'Alice' }
})No external parsers. Route schemas drive the TypeScript inference entirely, preserving safety across the network bridge.
Designed natively for Bun's extreme performance. Cold starts are lightning-fast with minimal overhead for every request.
Subscriptions via WebSockets and SSE are treated like HTTP endpoints. Type-safe streams directly mapped to identical contexts.
Forget external dependencies. The native `h` schema builder seamlessly generates types and acts as a runtime validator automatically.
Encapsulate logic beautifully. Any module export can be `.use()`d directly as a distinct application, enabling immense scale.
Your typing directly reflects the OpenAPI specification. Install a plugin to autogenerate pristine interactive documentation instantly.
Trusted By & Contributors