Realtime rooms, without the plumbing
The packages
Section titled “The packages”@insession/ws-resilient-transport
A WebSocket transport that reconnects the way a deploy actually needs it to: fast on a service restart, jittered exponential backoff otherwise, and a full stop on terminal close codes.
@insession/space-state
A state store for shared rooms — members, chat, presence, plugins. Inbound messages fold through a pure reducer; side effects come back as descriptors instead of firing.
Only one edge between them: space-state-react → space-state.
ws-resilient-transport is independent — carrying bytes and holding state are
kept apart on purpose, so you can adopt either one alone.
Why these
Section titled “Why these”Nothing to install underneath
The transport and the store have zero runtime dependencies. No framework, no socket library, no DOM. That is the point of them, not an accident.
Testable without a server
The store takes plain objects in and hands plain descriptors back, so a full state
transition is assertable in-process under node —test — no browser, no
sockets, no wall-clock waits.
Shaped by real deploys
The reconnect behaviour exists because every client drops at the same instant on every deploy. Fast path on service restart, jitter so the fleet does not stampede, and a hard stop when the server says never again.