| title | Quickstart |
|---|---|
| description | Install the `dbx` CLI, start the daemon, mint a token, and write your first aggregate. |
EventDBX ships as a single CLI named dbx. Follow the steps below to go from zero to a running daemon with authenticated client access.
npm install -g eventdbx
dbx start --foreground- Omit
--foregroundto run as a background service. - Use
--restrict=strictonce your schemas are locked in. - Logs stream to stdout; press
Ctrl+Cto stop the daemon when running in the foreground.
Generate boostrap token for initial access
dbx token bootstrap --stdout- Revoke tokens with
dbx token revoke <jti>if they leak. - Mint short-lived tokens with
dbx token generate ... --ttl 10m. - See Authorization for scoping
--action/--resourceand tenants.
import { createClient } from "eventdbxjs";
const client = createClient({
ip: process.env.EVENTDBX_HOST ?? "127.0.0.1",
port: Number(process.env.EVENTDBX_PORT) || 6363,
token: process.env.EVENTDBX_TOKEN,
tenantId: "default",
});
await client.connect();
await client.create("person", "p-110", "person_created", {
payload: {
fist_name: "Demo",
last_name: "Demo",
email: "jane@example.com",
},
metadata: { "@createdBy": "<current-id>" },
note: "person created by <email>",
});
const history = await client.events("person", "p-110");
console.log("Event count:", history.length);
await client.disconnect();Swap in the Python, Java, PHP, .NET, or Go SDKs described on the Client SDKs page if you prefer another language.
- Schema setup: use CLI schema commands to create and evolve schemas (e.g.,
dbx schema create ...,dbx schema add ...,dbx schema remove ...,dbx schema field ...,dbx schema alter ...), or edit theschema.jsonfiles under your shard folders if you prefer to define them manually; seedbx schema --helpfor the full command surface. - Snapshots and verification:
dbx aggregate snapshot <aggregate> <id>materializes the latest state, anddbx aggregate verifyrecomputes Merkle roots when you need to prove integrity. - Replication: run
dbx watch standbyto stream changes to a standby node, ordbx push/pullfor one-off syncs. - Plugins: configure HTTP or TCP plugins to fan events out to downstream services once your domain is populated.
Every CLI command accepts --config <path> if you need to target a custom configuration file or environment.