Documentation

Learn how to build event-sourced applications with Tannur.

Getting Started

1. Install the SDK

npm install @tannur/sdk

2. Initialize Tannur

import { Tannur } from "@tannur/sdk";

const tannur = new Tannur({
  apiKey: process.env.TANNUR_KEY
});

3. Append Events

await tannur.append("orders", {
  type: "ORDER_CREATED",
  data: { id: "ord_123", total: 99.99 }
});

Core Concepts

  • Events - Immutable records of state changes
  • Streams - Ordered sequences of events
  • Projections - Derived views from events
  • Snapshots - Performance optimization for large streams

API Methods

tannur.append(stream, event)

Append a new event to a stream

tannur.read(stream, options)

Read events from a stream

tannur.subscribe(stream, callback)

Subscribe to real-time updates

tannur.project(stream, reducer)

Create a projection from events

Examples

  • • E-commerce Order System
  • • Real-time Chat Application
  • • Collaborative Document Editor
  • • Financial Transaction Ledger