Gathering detailed insights and metrics for react_native_mqtt_paho
Gathering detailed insights and metrics for react_native_mqtt_paho
Gathering detailed insights and metrics for react_native_mqtt_paho
Gathering detailed insights and metrics for react_native_mqtt_paho
npm install react_native_mqtt_paho
Typescript
Module System
Node Version
NPM Version
JavaScript (93.07%)
Objective-C (3.95%)
Python (1.54%)
Java (1.18%)
TypeScript (0.26%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
97 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Dec 11, 2021
Latest Version
1.2.2
Package Id
react_native_mqtt_paho@1.2.2
Unpacked Size
4.05 kB
Size
2.15 kB
File Count
3
NPM Version
5.6.0
Node Version
8.10.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
This package is a wrapper around the javascript implementation of the paho mqtt client library to provide drop in compatibility with react native. If you happen to be running your own mqtt broker, it must support websockets for a connection to be possible.
To install, use npm:
npm install react_native_mqtt --save
To use the library just pass in the options for the local storage module (react-native-storage) and the paho object will be attached to global scope.
1import init from 'react_native_mqtt'; 2import { AsyncStorage } from 'react-native'; 3 4init({ 5 size: 10000, 6 storageBackend: AsyncStorage, 7 defaultExpires: 1000 * 3600 * 24, 8 enableCache: true, 9 reconnect: true, 10 sync : { 11 } 12}); 13 14function onConnect() { 15 console.log("onConnect"); 16} 17 18function onConnectionLost(responseObject) { 19 if (responseObject.errorCode !== 0) { 20 console.log("onConnectionLost:"+responseObject.errorMessage); 21 } 22} 23 24function onMessageArrived(message) { 25 console.log("onMessageArrived:"+message.payloadString); 26} 27 28const client = new Paho.MQTT.Client('iot.eclipse.org', 443, 'uname'); 29client.onConnectionLost = onConnectionLost; 30client.onMessageArrived = onMessageArrived; 31client.connect({ onSuccess:onConnect, useSSL: true });
To run the example, first make sure you have properly setup your env for react native development in ios and/or android: https://facebook.github.io/react-native/releases/0.21/docs/getting-started.html.
Then start the tsc compiler to watch and re-build changes, start up the js packager, and run android or ios.
cd /react-native-mqtt/
yarn
yarn run dev
cd /react-native-mqtt/example/
yarn
yarn start --reset-cache
cd /react-native-mqtt/example/
react-native run-android OR react-native run-ios
Lastly, once you have the example running, you can use this web app to verify that everything works as expected by publishing messages to the "WORLD" topic, using the config below.
Host: iot.eclipse.org
Port: 443
SSL: true
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
110 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More