Skip to content

Commit

Permalink
Merge pull request #62 from kaandesu/chore/refactor&fix
Browse files Browse the repository at this point in the history
chore: update docs & minor fix
  • Loading branch information
kaandesu authored Jun 2, 2023
2 parents 3791012 + 5cf7432 commit e0b0b98
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/pahoMqttPlugin/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import {
clientId,
host,
mainTopic,
password,
port,
status,
useSSL,
username,
} from './mqttSettings';
import {
clearMsgHandlers,
Expand Down

0 comments on commit e0b0b98

Please sign in to comment.