Skip to main content

HelioDB

HelioDB provides the primitives agents need: durable event streams with history+live subscriptions, serverless wake-up via webhooks, and cursor-based resumption.

Quick Start

1. Start the Server

git clone https://github.com/heliodb/heliodb && cd heliodb
make build

HELIODB_SECRET=dev-secret cargo run -p heliodb-server -- \
  --db :memory: --secret $HELIODB_SECRET --port 8080

# Generate a token
cargo run -p heliodb-server -- generate-token \
  --namespace default --subject developer --full-access --secret $HELIODB_SECRET

2. Install the Client

pnpm add @heliodb/client @heliodb/contract zod

3. Log and Subscribe

import { HelioDB } from "@heliodb/client";
import { heliodb } from "@heliodb/contract";
import { z } from "zod";

const contract = {
  chat: heliodb.resource("chat/{roomId}").events({
    message: z.object({ text: z.string(), userId: z.string() }),
  }),
} as const;

const client = new HelioDB({
  url: "ws://localhost:8080/ws",
  contract,
  token: "<your-token>",
  namespace: "default",
});

const room = client.resources.chat({ roomId: "general" });

// Log events
room.log({ type: "message", data: { text: "hello", userId: "alice" } });

// Subscribe: history first, then live
const subscription = await room.subscribe();
for await (const event of subscription) {
  console.log(event.id, event.type, event.data);
}

Key Features

Subscribe = History + Live - One API call returns complete event history, then continues streaming live events. Serverless Agent Protocol - Register agents with webhook URLs. HelioDB wakes your agent when events arrive. Type-Safe Contracts - Define events with Zod schemas. TypeScript types flow everywhere. Pluggable Storage - SQLite, Postgres, ClickHouse backends. Same API.

Next Steps