A zero-dependency MQTT over WebSocket client for JavaScript/TypeScript. Current stable version is 0.0.9 (beta, infrequent releases). Supports MQTT 3.1.1 with QoS 0 and 1, last will testament, and message callbacks. Differentiator: no external dependencies unlike mqtt.js, and ships TypeScript types. Lightweight alternative for simple MQTT-over-WebSocket use cases, but lacks MQTT 5, TLS in Node.js, and advanced features.
npm install websocket-mqttNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates connecting, subscribing, publishing, and disconnecting with an MQTT WebSocket client.
Pin to exact version and test upgrades.
Use new TextDecoder().decode(payload) or toString() on the array.
Use mqtt.js if you need native TCP MQTT.
Limit subscribe/publish options to { qos: 0 | 1 }.Attach event listeners after await client.connect() resolves, or in the 'connect' event callback.
Provide a valid username and password in the options object, or check the server's authentication settings.
Ensure the URL begins with ws:// or wss:// and is a properly formatted URI.
No dependency data recorded yet.