Your First Event
Send an event to DeltaBase in 2 minutes
You signed up. Let’s make something happen.
What you’ll do:
- Create an event store (30 seconds)
- Get an API key (30 seconds)
- Install the SDK and send an event (60 seconds)
No theory. No philosophy. Just events going in.
Section titled “No theory. No philosophy. Just events going in.”Quick video walkthrough
Section titled “Quick video walkthrough”Video walkthrough coming soon
2-minute demo of this entire flow
Step 1: Create an event store
Section titled “Step 1: Create an event store”Go to your DeltaBase dashboard.
Click Create Event Store. Name it my-first-store (or whatever you’ll remember).
Done. That’s your event database.
Step 2: Get an API key
Section titled “Step 2: Get an API key”Still in the dashboard → API Keys → Create.
Copy the key immediately. You won’t see it again. This is security, not drama.
Set it in your terminal:
export DELTABASE_API_KEY=your-key-hereStep 3: Send an event
Section titled “Step 3: Send an event”Install the SDK:
npm install @delta-base/serverpnpm add @delta-base/serveryarn add @delta-base/serverbun add @delta-base/serverCreate first-event.ts:
import { DeltaBase } from '@delta-base/server';
const client = new DeltaBase({ apiKey: process.env.DELTABASE_API_KEY!, baseUrl: 'https://api.delta-base.com'});
const eventStore = client.getEventStore('my-first-store');
async function main() { // Send your first event await eventStore.appendToStream('user-123', [{ type: 'user.signed_up', data: { email: 'hello@example.com', plan: 'free' } }]);
console.log('Event sent! Check your dashboard.');
// Read it back const { events } = await eventStore.readStream('user-123'); console.log('Events:', events);}
main().catch(console.error);Run it:
npx tsx first-event.tspnpm dlx tsx first-event.tsyarn dlx tsx first-event.tsbun run first-event.tsStep 4: See it land
Section titled “Step 4: See it land”Back to your dashboard → Click your event store → Events.
Your event is there. Immutable. Forever.
That’s event sourcing. Facts that can’t be deleted or changed.
What just happened?
Section titled “What just happened?”You stored an immutable business fact. This is the foundation of:
- Perfect audit trails - “Who did what, when, and why?”
- Time-travel debugging - “What did the system look like last Tuesday?”
- Systems that don’t lose data - Events are append-only, never overwritten
Your traditional database would have just said balance: 150. DeltaBase tells you how you got to 150.
Something not working?
Section titled “Something not working?”“Unauthorized” error: Check your API key. Run echo $DELTABASE_API_KEY to verify it’s set.
“Event store not found”: Create the event store first in the dashboard. It’s Step 1.
“Connection refused”: Make sure you’re using https://api.delta-base.com, not localhost.
What’s next?
Section titled “What’s next?”Build something real:
- Banking system - Accounts, deposits, withdrawals with proper commands
- Shopping cart - Inventory, conflicts, real e-commerce
Understand the patterns:
- The Decider Pattern - Bulletproof business logic with pure functions
- Event sourcing fundamentals - Why this architecture wins
Set up local development:
- Local dev environment - Run DeltaBase on your machine for faster iteration