OpenIM WebSocket client library (v1.0.41) for connecting to OpenIM WebSocket servers in browser and Node.js environments. Built with TypeScript, it provides automatic reconnection, authentication headers, and event-based messaging with subscribe/unsubscribe capabilities. Heavily tailored for OpenIM backend services (requires Appid, ClientId, etc.), not a generic WebSocket client. Release cadence appears active with frequent updates. Differentiator: dedicated OpenIM protocol support with built-in auth, logging, and reconnection logic.
npm install openim-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes OpenIMWebSocket with auth headers, connects, subscribes to a topic, and sends a publish message. Secure via env variables.
Ensure the headers object has all five required fields. Missing any will cause connection to fail silently.
Use import or set type: 'module' in package.json. If you need CJS, consider dynamic import().
Error handling may require listening to the 'error' event. Check if connect() actually rejects; if not, wrap with timeout.
Use import { OpenIMWebSocket } from 'openim-websocket'.Verify headers contain valid Authorization: Bearer <token> and that Appid, ClientId, Timestamp are correct and current.
Run npm install openim-websocket. For TypeScript projects, ensure tsconfig includes 'node_modules' or types.
No dependency data recorded yet.