Isomorphic WebSocket client with auto-reconnect, connection timeout, message queuing, and extensible retry strategy. Works in browser and Node.js. Current stable version is 0.5.0. Supports standard WebSocket API, typed events, and custom reconnection URLs. Differentiates from alternatives like ws or reconnecting-websocket by being isomorphic and providing built-in retry and queue.
npm install iso-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: create WebSocket connection with retry and connection timeout.
Install ws as a dependency if using Node.js without bundler.
Use package.json resolutions or lockfile.
Set options.queueMessages: false to disable.
Ensure you pass url first, then protocols array, then options object.
npm install ws
import { WS } from 'iso-websocket'Call ws.send only after 'open' event is fired