Vue 2 plugin that integrates MQTT over WebSocket using the MQTT.js library, enabling real-time messaging in Vue applications. Current stable version is 2.0.3 with no active releases in recent years. It provides a simple Vue plugin interface to configure a global MQTT client, then use $mqtt on instances for subscribe/publish and declarative topic handlers in component options. Key differentiators: minimal setup, subscription at component level, and automatic client management. Limited to Vue 2 and not compatible with Vue 3 or newer MQTT.js versions.
npm install vue-mqttNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with Vue.use(), adding a subscription via mqtt option, and a method to publish.
Call Vue.use(VueMqtt, ...) at the entry point of your app, before new Vue().
Define subscriptions as a flat object where keys are MQTT topic strings.
Use default import: import VueMqtt from 'vue-mqtt'.
Ensure Vue.use(VueMqtt, ...) is called before new Vue() in your entry file.
Double-check the broker URL and options object passed to Vue.use(). Ensure URL is a valid WebSocket endpoint.
Run 'npm install vue-mqtt --save' and ensure import path is correct.
No dependency data recorded yet.