Getting Started
July 9, 2026 ยท View on GitHub
Prerequisite: Chronicle Kernel
You need a running Chronicle Kernel before connecting with the TypeScript client.
The easiest local setup is the development Docker image:
docker run -p 35000:35000 cratis/chronicle:latest-development
Installation
yarn add @cratis/chronicle reflect-metadata
Note:
reflect-metadatais required for TypeScript decorators to work at runtime. Import it once at the entry point of your application.
Setup
Import reflect-metadata at the top of your application entry point:
import 'reflect-metadata';
Connecting to Chronicle
Create a ChronicleClient with a connection string pointing to your Chronicle Kernel instance:
import { ChronicleClient, ChronicleOptions } from '@cratis/chronicle';
const options = ChronicleOptions.fromConnectionString('chronicle://localhost:35000');
const client = new ChronicleClient(options);
// Get an event store
const store = await client.getEventStore('MyStore');
// ... use the store
// Always dispose when done
client.dispose();
Connection String Format
Chronicle connection strings use the chronicle:// scheme:
chronicle://localhost:35000
chronicle://username:password@chronicle.example.com:35000
Development Mode
For local development, use:
const options = ChronicleOptions.development();
This connects to chronicle://localhost:35000 by default.
Where to next
- Events and event logs, Event Types, and Event Evolution to model and evolve your event schema.
- Reducers, Reactors, and Projections to build read models and side effects from your events.
- Read Models to query projected state.
- Event Seeding and Transactions for test data and unit-of-work semantics.
- Compliance for PII handling and GDPR erasure.