System.Text.Json or forward envelopes directly to workers.
Feature highlights
- Async-first API surface with Task-returning methods and
IAsyncDisposablecleanup. - Create/apply/patch/archive helpers plus per-call publish target routing to plugins.
- Aggregate reads for
get,select,list,events, andverifywith 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 = falsefor 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.EventDbxClientOptions.
Write aggregates and events
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
Noise transport
Noise NNpsk0 is enabled by default and derives a PSK from the control token. Only disable it for trusted lab sockets by settingUseNoise = false in EventDbxClientOptions.