react-realtime-hooks
JSON →A production-ready React library providing composable hooks for WebSocket and Server-Sent Events (SSE) with auto-reconnect, heartbeat, typed connection states, and browser network awareness. Current stable version is 2.0.2, released in 2024, with a release cadence of approximately monthly. Key differentiators include discriminated connection snapshots (idle, connecting, open, reconnecting, closing, closed, error), exponential backoff with jitter, heartbeat with ack matching and latency measurement, environment-aware connection gating for offline state and background tabs, and zero runtime dependencies beyond React. Ships TypeScript types, supports React 18+, and is SSR- and Strict Mode-safe.
Resources
packagereact-realtime-hooks ↗
API endpoints
full doc /v1/registry/react-realtime-hooks