React Native Reconnecting WebSocket

JSON →
library 2.0.0 ·javascript
verified Jun 7, 2026

A drop-in replacement for the standard WebSocket API in React Native that automatically reconnects when the connection drops. This library wraps the native WebSocket module and provides exponential backoff reconnection logic, configurable intervals, and max attempts. It is API-compatible with the native WebSocket, so you can replace `new WebSocket(url)` with `new ReconnectingWebSocket(url)` without changing event listeners. Current stable version is 2.0.0. Release cadence is low; last release was in 2021. Key differentiators: designed specifically for React Native (no browser dependencies), supports headers (including Cookie and custom Origin), and exposes options like reconnectInterval, maxReconnectInterval, reconnectDecay, timeoutInterval, and maxReconnectAttempts.