For developers

TypeScript builders for real backends.

Services from a ServiceBuilder. Commands and subscriptions chained as typed builders. Schemas with Zod. Handler context with logger, resources, stores, emit and cross-service invocation — fully inferred end to end.

Paradigm Message-driven · type-safe
Runtime Node · Bun · Edge · Serverless
Bridges AMQP · NATS · MQTT · Dapr · in-memory
Scroll
Builders 0 ServiceBuilder · getCommandBuilder · getSubscriptionBuilder.
Event bridges 0 AMQP · NATS · MQTT · Dapr · in-memory. Bring your own.
Runtimes 0 Node · Bun · Kubernetes · serverless / edge — same code.
Inferred 0% Zod schemas propagate through every handler signature.
The shape

Every service has the same anatomy .

A service is a typed container of primitives: commands, subscriptions, streams, queues and AI agents. It declares owner, version and IAM. The event bridge handles routing. Adapters bind concrete infrastructure at boot — never imported in your code.

Builder pattern

A command, built step by step .

Every command is a chain of typed calls — schemas, exposure, events it can emit, then the handler. Inference flows through the chain so payload and ctx are fully typed inside your function body.

  • 01

    Get the builder from the service

    orderService.getCommandBuilder(name, description) — locked to that service's typed surface.

  • 02

    Attach Zod schemas

    addPayloadSchema, addParameterSchema, addOutputSchema. Validated at the boundary, inferred everywhere downstream.

  • 03

    Declare exposure & events

    exposeAsHttpEndpoint, canEmit, canInvoke — the framework auto-generates OpenAPI and gates cross-service calls.

  • 04

    Wire the handler

    setCommandFunction(async function (ctx, payload, parameter) {...}). Returns are validated against the output schema.

createOrder.builder.ts TYPESCRIPT
123456789101112
// 1. Build the commandexport const createOrderBuilder = orderService  .getCommandBuilder('createOrder', 'Place a new order')  .addPayloadSchema(createOrderInput)  .addOutputSchema(orderConfirmed)  .exposeAsHttpEndpoint('POST', 'orders')  .canEmit('OrderPlaced', orderPlacedEvent)  .setCommandFunction(async function (ctx, payload) {    const id = await ctx.resources.db.insert('orders', payload)    await ctx.emit('OrderPlaced', { id })    return { id, status: 'confirmed' }  })
Real builder API — every method is type-checked against the schemas above it.
Handler context

Inside the handler: everything typed .

The first argument to every handler is the context. It exposes logger, resources, secrets, configs, and states, emit, cross-service invocation, queue helpers, and OpenTelemetry spans — all inferred from your service definition.

ctx.logger

Scoped logger with trace correlation.

ctx.logger.info(...)
ctx.resources

Typed dependencies declared on the service.

ctx.resources.db
ctx.secrets / configs / states

Secret · config · state. Provider-agnostic.

ctx.secrets.getSecret(...)
ctx.emit

Emit events; downstream subscriptions react.

ctx.emit(name, payload)
ctx.service

Typed cross-service command invocation.

ctx.service.Profile['1'].create(...)
ctx.queue

Enqueue background jobs durably.

ctx.queue.enqueue(...)
ctx.spans

Wrap any block in an OpenTelemetry span.

ctx.wrapInSpan(name, fn)
ctx.message

Trace ID, tenantId, principalId, headers.

ctx.message.principalId
Subscriptions

Listen, react, move on .

A subscription is a typed reaction to an event from another service. Same builder discipline as commands — but fire-and-forget. Filter by sender, principal or tenant; advise durability and acknowledgement.

onPaid.subscription.ts TYPESCRIPT
123456789
// React to events emitted by other servicesexport const onPaid = orderService  .getSubscriptionBuilder('onPaid', 'mark order paid')  .subscribeToEvent('Payment', '1', 'PaymentMade')  .addPayloadSchema(paymentMadeEvent)  .setSubscriptionFunction(async function (ctx, payload) {    await ctx.resources.db.markPaid(payload.orderId)    ctx.logger.info('order paid', payload)  })
Subscribe to Payment.PaymentMade — the framework routes, retries and traces automatically.
Start building

Scaffold a service. Ship a system .

The Handbook walks you from a single command on an in-memory bridge to a multi-service deployment on the broker of your choice.