From d8059b9d1dfc1a9651980508d6f88c7fa1e11d8d Mon Sep 17 00:00:00 2001 From: kaan Date: Fri, 2 Jun 2023 20:08:32 +0200 Subject: [PATCH 1/2] fix: imports from mqttSettings --- src/pahoMqttPlugin/utils/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pahoMqttPlugin/utils/index.ts b/src/pahoMqttPlugin/utils/index.ts index 69d84ce..50f0151 100644 --- a/src/pahoMqttPlugin/utils/index.ts +++ b/src/pahoMqttPlugin/utils/index.ts @@ -5,11 +5,9 @@ import { clientId, host, mainTopic, - password, port, status, useSSL, - username, } from './mqttSettings'; import { clearMsgHandlers, From 5cf743243d8860fd892dc543780054d614de2df5 Mon Sep 17 00:00:00 2001 From: kaan Date: Fri, 2 Jun 2023 20:13:10 +0200 Subject: [PATCH 2/2] chore: update docs Closes #59. --- README.md | 34 ++++++++++++++++++++++++++++++++++ SECURITY.md | 1 + 2 files changed, 35 insertions(+) diff --git a/README.md b/README.md index 8455c79..113a5cd 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ This plugin allows you to connect to a MQTT broker and subscribe to topics in yo - [Installation](#installation) - [Setup](#setup) + - [Vite / VueCLI](#vite--vuecli) + - [Quasar](#quasar-framework-quasar-boot) + - [Nuxt3](#nuxt3-nuxt-plugins) - [Options](#options) - [Plugin Options](#plugin-options) - [MQTT Options](#mqtt-options) @@ -127,6 +130,37 @@ export default boot(({ app }) => { }); ``` +### Nuxt3 ([nuxt plugins](https://nuxt.com/docs/guide/directory-structure/plugins)) + +```ts +import { createPahoMqttPlugin } from 'vue-paho-mqtt'; +export default defineNuxtPlugin({ + name: 'vue-paho-mqtt', + enforce: 'pre', + async setup(nuxtApp) { + nuxtApp.vueApp.use( + createPahoMqttPlugin({ + PluginOptions: { + autoConnect: true, + showNotifications: true, + }, + MqttOptions: { + host: 'localhost', + port: 9001, + clientId: `MyID-${Math.random() * 9999}`, + mainTopic: 'MAIN', + }, + }), + ); + }, + hooks: { + 'app:created'() { + const nuxtApp = useNuxtApp(); + }, + }, +}); +``` + --- ## Options diff --git a/SECURITY.md b/SECURITY.md index f019e7e..0a6f649 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,6 +6,7 @@ We release patches for security vulnerabilities. Here are the versions that are | Version | Supported | | ------- | --------- | +| 0.3.x | ✅ | | 0.2.x | ✅ | ## Reporting a Vulnerability