Stayge WebSocket Client SDK for browser and React Native environments. This SDK provides a unified interface for connecting to Stayge's WebSocket gateway server with built-in heartbeat, reconnection, and event-driven message handling. The current stable version is 0.1.35, and it is released with no fixed cadence. Key differentiators include separate entry points for React (`react`) and React Native (`react-native`), automatic JSON parsing, and built-in heartbeat with customizable intervals and timeouts. It requires token issuance via a REST API for topic subscriptions.
npm install stayge-ws-client-sdkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a Stayge WebSocket server, subscribes to a topic, handles messages and errors.
Use import { getWebSocketClient } from 'stayge-ws-client-sdk/react' for React projects.Call POST /api/youmeon/v1/websocket/token to get a token, then pass it to ws.subscribe({ topic, token }).Specify heartbeat.pingIntervalMs in connect() to change interval.
Register event handlers before connect() if you need to guarantee they are active from the start.
Use import { getWebSocketClient } from 'stayge-ws-client-sdk/react' or '/react-native'.Ensure you call ws.connect() first and pass a valid token to subscribe().
Use ES import syntax: import { getWebSocketClient } from 'stayge-ws-client-sdk/react'.Obtain a fresh token via POST /api/youmeon/v1/websocket/token and call ws.subscribe again.
No dependency data recorded yet.