Skip to main content
The .NET SDK targets .NET 8+, opens a persistent TCP connection to the EventDBX control socket, and speaks Cap’n Proto over Noise NNpsk0 by default. It returns JSON payloads so you can hydrate POCOs with System.Text.Json or forward envelopes directly to workers.

Feature highlights

  • Async-first API surface with Task-returning methods and IAsyncDisposable cleanup.
  • Create/apply/patch/archive helpers plus per-call publish target routing to plugins.
  • Aggregate reads for get, select, list, events, and verify with filters, cursors, and sorting.
  • Snapshot helpers (create, list, get) and control-plane admin for schemas and tenants.
  • Noise transport enabled by default; opt out with UseNoise = false for lab sockets.
  • Per-call token overrides; tenant selection happens during the initial handshake.

Install

Targets .NET 8.0. The package is cross-platform and works on Windows, Linux, and macOS.

Connect and configure

ConnectAsync performs the handshake and returns a connected client. Dispose it during graceful shutdown to release the socket.

Runtime configuration

Pass these into EventDbxClientOptions; the client does not read environment variables automatically.

Manage authentication and tenancy

Override tokens per call to scope permissions. Tenant IDs are fixed at connect time; spin up a separate client per tenant.
If no override is provided, the client reuses the token from EventDbxClientOptions.

Write aggregates and events

Payloads, metadata, and patches are serialized with System.Text.Json; anonymous types or POCOs both work.

Read aggregates and events

ListAggregatesAsync and ListEventsAsync return JSON strings and cursor metadata; feed NextCursor into subsequent calls to resume paging.

Filters, sorting, and pagination

Filters use the same SQL-like grammar as the control plane (field = value AND other_field > 10). Sort fields accept names such as aggregate_type, aggregate_id, created_at, updated_at, and archived. You can pass a raw string via SortText ("created_at:desc,aggregate_id:asc") or a strongly typed list of AggregateSortOption. Timestamp cursors (ts:<aggregate_type>:<aggregate_id>) pass through unchanged when used with timestamp sorts.

Snapshots and admin helpers

These helpers cover point-in-time snapshots plus schema and tenant management flows (assign/unassign, quotas, reloads, and schema publication).

Noise transport

Noise NNpsk0 is enabled by default and derives a PSK from the control token. Only disable it for trusted lab sockets by setting UseNoise = false in EventDbxClientOptions.