@soluzioni-futura/aws-mqtt-client-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

aws-mqtt-client-utils

Quick start

Install the package

$ npm i @soluzioni-futura/aws-mqtt-client-utils

Usage

    import getAwsMqttClient from "@soluzioni-futura/aws-mqtt-client-utils"

    const mqttClient = getAwsMqttClient({
      awsAccessKeyId: <your-access-key>,
      awsSecretAccessKey: <your-secret-key>,
      awsSessionToken: <your-session-token>,
      iotEndpoint: <your-iot-endpoint>,
      region: <your-region>
    })

    mqttClient.onMessageArrived = (message) => {
      console.log("New message arrived on", message.topic)
      console.log(JSON.parse(message.payloadString))
    }

    mqttClient.connect({
      onSuccess: () => {
        console.log("Connected!")
        mqttClient.subscribe("$aws/things/+/shadow/update/accepted")
      }
    })

Readme

Keywords

Package Sidebar

Install

npm i @soluzioni-futura/aws-mqtt-client-utils

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

12.9 kB

Total Files

9

Last publish

Collaborators

  • riccardorispoli
  • giovanni.bruno
  • nico.fuccella
  • vforvalerio87
  • zhoujian26
  • allemonta