Drivers & integrations
Drivers and protocol
How clients reach a NYXDB node — HTTP and WebSocket routes and the TypeScript client.
A node speaks two transports on its client listener: HTTP for session exchange, one-shot SQL and bulk writes, and a multiplexed WebSocket session for everything else, including streaming reads.
ProtocolHTTP routes, the WebSocket session, frames and result documents.Query lifecycleRequest ids, demand credit, progress, completion and Cancel.
TypeScript client
@nyxdb/client runs in browsers and Node and covers the whole public protocol:
- decodes the HTTP result document
nyxdb.query-result/2and the WebSocket exact result batches, keeping every value lossless (integers asbigint, decimals with their precision and scale, binary values asUint8Array); - exchanges a bearer for a session, and logs in with a password or an API key when the node has an issuer;
- sends bounded write batches and resumable bulk-load frames;
- multiplexes independently cancellable queries over one WebSocket session, replenishes demand and reports progress;
- decodes system relations, including the federation relations.
It sends a password or API key only over https://, or over http:// to a
loopback host, and it never follows an HTTP redirect.