0.0.1 - Client library for subscribing to Tuya IoT platform messages via WebSocket, wrapping Pulsar message consumption. Provides event-driven callbacks for open, message, reconnect, ping, pong, close, and error events. Supports automatic reconnection, ack-based message handling, and multiple environments (CN, US, EU). Requires an access ID and key. Not for production due to early version; lacks documentation on error handling and security.
npm install tuya-wsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a Tuya WebSocket client with credentials and environment, sets up open, message, and error event handlers, acknowledges received messages, and starts consumption.
Consider locking version in package.json.
Always register event handlers before calling client.start().
Call client.ackMessage(message.messageId) inside the message callback.
Use ^0.0.1 in package.json to allow only patch updates.
Run 'yarn add tuya-ws' or 'npm install tuya-ws'.
Use 'import TuyaWebsocket from 'tuya-ws'' and ensure package.json has 'type': 'module'.
Add 'accessId: process.env.TUYA_ACCESS_ID ?? '' ' to constructor options.
No dependency data recorded yet.