EVRYTHNG-MQTT.JS (plugin for EVT.js)
evrythng-mqtt.js is an extension plugin to be used with evrythng.js or evrythng-extended.js JS libraries.
It adds MQTT support to any resource, allowing to publish, subscribe and unsubscribe to the resource's topics easily.
evrythng-mqtt.js is only available for Node.js as a NPM package. For browsers, consider using evrythng-ws.js.
Installation
Node.js
npm install evrythng-mqtt --save
Usage
var EVT = mqtt = ; EVT;...
Examples
General
Use specific settings (below are defaults)
mqtt;
Authenticate as an Operator and read a Thng object:
var operator = OPERATOR_API_KEY;var thngResource = operator;
Subscribe to property updates of a particular Thng:
thngResource;
Publish property updates:
thngResource;
Create an action:
thngResourceaction'scans';
Update a Thng:
thngResource;
Unsubscribe to a subscribed topic:
thngResource;
Documentation
Check all the available subscriptions on the EVRYTHNG Pubsub documentation.
Source Maps
Source Maps are available, which means that when using the minified version, if you open Developer Tools (Chrome, Safari, Firefox), .map files will be downloaded to help you debug code using the original uncompressed version of the library.
Related tools
evrythng.js
evrythng.js
is the core version of evrythng.js intended to be used in
public applications and/or devices.
evrythng-extended.js
evrythng-extended.js
is an extended version of evrythng.js which
includes Operator access to the API.
License
Apache 2.0 License, check LICENSE.txt
Copyright (c) EVRYTHNG Ltd.