Skip to content
Welcome to Hedystia

Hedystia

Build APIs with Confidence

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.

Start Building
$bun add hedystia
server.ts
ts
import 
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)

One unified inference.

Your server schemas are perfectly mirrored to the client. Real-time updates with zero code generation delays.

SERVER CONFIGURATION

server.ts
ts
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
app

CLIENT INTEGRATION

client.ts
ts
import { 
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' }
})

Core Capabilities

End-to-End Safety

No external parsers. Route schemas drive the TypeScript inference entirely, preserving safety across the network bridge.

Built on Bun

Designed natively for Bun's extreme performance. Cold starts are lightning-fast with minimal overhead for every request.

Real-Time First

Subscriptions via WebSockets and SSE are treated like HTTP endpoints. Type-safe streams directly mapped to identical contexts.

Built-in Builder

Forget external dependencies. The native `h` schema builder seamlessly generates types and acts as a runtime validator automatically.

Plugins Architecture

Encapsulate logic beautifully. Any module export can be `.use()`d directly as a distinct application, enabling immense scale.

Auto-Swagger Docs

Your typing directly reflects the OpenAPI specification. Install a plugin to autogenerate pristine interactive documentation instantly.

Trusted By & Contributors