Stack Gems
Menu
← Catalog

MQTT.js

MIT Node + browser MQTT client — needs a broker

Comms / Realtime · OSS/MIT · 9.1k

Reviewed 2026-09-10 · last push 2026-10-16 · repo checked 2026-10-19

What's Good

MIT. mqttjs/MQTT.js (npm `mqtt`). Connect, publish, subscribe with QoS and MQTT 5 paths. Works in Node and browsers; CLI helpers ship with the package. Same “library needs a server” shape as matrix-js-sdk — pair with Mosquitto or any MQTT broker.

The Catch

Client library only — not a broker (that is Mosquitto/HiveMQ/etc.). Browser is MQTT-over-WebSockets only (no raw MQTT TCP from the page). You still provide a reachable broker, credentials, and topic design. Distinct from Mosquitto.

Verdict

MIT MQTT client. Free library; bring a broker — browsers speak WebSockets.

Embed

Maintainer? Add the badge to your README. It is free, links to this review, and there is no paid version.

Reviewed on Stack Gems

Markdown

[![Reviewed on Stack Gems](https://stackgems.com/badge/mqtt-js.svg)](https://stackgems.com/gems/mqtt-js)

HTML

<a href="https://stackgems.com/gems/mqtt-js"><img src="https://stackgems.com/badge/mqtt-js.svg" alt="MQTT.js reviewed on Stack Gems" height="20"></a>