0.1.3 • Published 4 years ago
node-prehubclient v0.1.3
Mqtt Prehub Client
Mqtt Prehub javascript/node client
Connect to a mqtt broker with a prehub operating for device provisioning.
const builder = new PreHubClientBuilder().host('localhost').port(1833);
const device: IDevice = {
id: Guid.newGuid(),
name: 'Barcode scanner #1',
activity: Activity.Scan
};
const prehub = new PreHubClient(builder, device);
prehub.connect();
prehub.register();
Installation
npm install node-prehubclient
Setup
- Connect to Mqtt Broker with the Prehub operating.
const builder = new PreHubClientBuilder().host('localhost').port(1833);
- Configure the device the client is running as.
const device: IDevice = { id: Guid.newGuid(), name: 'Barcode scanner #1', activity: Activity.Scan };
- Connect to the Mqtt broker through the Prehub client.
- Register the device with the Prehub for provisioning. Once registered, the device will be configured from the prehub. This will include activation/deactivation, any configuration of the device/payload, Device metadata etc.