Skip to content

Your First Event

Send an event to DeltaBase in 2 minutes

You signed up. Let’s make something happen.

What you’ll do:

  1. Create an event store (30 seconds)
  2. Get an API key (30 seconds)
  3. 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.”

Video walkthrough coming soon

2-minute demo of this entire flow


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.


Still in the dashboard → API KeysCreate.

Copy the key immediately. You won’t see it again. This is security, not drama.

Set it in your terminal:

Terminal window
export DELTABASE_API_KEY=your-key-here

Install the SDK:

Terminal window
npm install @delta-base/server

Create 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:

Terminal window
npx tsx first-event.ts

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.


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.


“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.


Build something real:

Understand the patterns:

Set up local development: