A WebSocket client library for subscribing to Tuya IoT platform messages. Version 1.0.2 provides real-time message streaming with built-in reconnection and acknowledgement support. Released as a Node.js SDK, it requires Node.js >=12.0. Differentiates from generic WebSocket clients by offering Tuya-specific URL presets, environment configuration (PROD/DEV), and auto-retry logic. Limited documentation and community adoption may impact troubleshooting.
npm install message-subscription-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Tuya WebSocket client with credentials, connect, handle messages with acknowledgement, and start the connection.
Always call client.ackMessage(message.messageId) inside the message callback.
Ensure both accessId and accessKey are provided in the constructor options.
Use import TuyaWebsocket from 'message-subscription-websocket' or use dynamic import().
Use TuyaWebsocket.URL.CN (or US, EU, IN, WE, EA).