Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

aws-iot-paho-mqtt

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-iot-paho-mqtt

A lightweight library to connect to the AWS IoT Service using an ESM friendly code based on paho-mqtt

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

AWS IOT PAHO MQTT

This package is a lightweight library to connect to the AWS IoT Service using an ESM friendly code based on paho-mqtt and crypto-js

If you have any issues or feature requests, please file an issue or pull request.

This small library was built as an ad-hoc replacement for a particular use case where the use of the packages provided by aws was not useful since they do not support ESM and have many node-related dependencies.

Installation

Use your favorite package manader

npm install aws-iot-paho-mqtt

yarn add aws-iot-paho-mqtt

pnpm add aws-iot-paho-mqtt


## Usage

Import the package and connect to the IoT service

```js
import { IoTMqttClient} from 'aws-iot-paho-mqtt';

IoTMqttClient.getInstance().connect();

Then somewhere else in your code you can subscribe or unsubscribe to a topic

const subscribed = IoTMqttClient.getInstance().subscribeToTopic(topicUrl);

IoTMqttClient.getInstance().unsubscribeFromTopic(topicUrl);

Or listen to some of the events

  • client-connected
  • client-disconnected
  • data (for when a message arrive)
  • dataSent (for when a message is sent)

FAQs

Package last updated on 19 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts