# node-prehubclient

> Mqtt PreHub client

Latest version **0.1.3** (published 2020-04-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-prehubclient
pnpm add node-prehubclient
yarn add node-prehubclient
bun add node-prehubclient
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2020-04-21 |
| First published | 2020-04-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | smacken |
| Maintainers | smacken |
| Keywords | mqtt, prehub |

## Links

- npm: https://www.npmjs.com/package/node-prehubclient
- Repository: https://git@github.com/smacken/node-prehubclient
- Homepage: https://github.com/smacken/node-prehubclient#readme
- Issues: https://github.com/smacken/node-prehubclient/issues
- npm.io page: https://npm.io/package/node-prehubclient

## Dependencies (3)

- [mqtt](https://npm.io/package/mqtt.md) ^3.0.0
- [mocha](https://npm.io/package/mocha.md) ^7.0.1
- [async-mqtt](https://npm.io/package/async-mqtt.md) ^2.5.0

## Recent versions

- 0.1.3 (latest) — 2020-04-21
- 0.1.2 — 2020-04-19
- 0.1.1 — 2020-04-19

## README

# Mqtt Prehub Client
> Mqtt Prehub javascript/node client

Connect to a mqtt broker with a prehub operating for device provisioning.

```typescript
    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

```shell
    npm install node-prehubclient
```

## Setup

1. Connect to Mqtt Broker with the Prehub operating.
    ```typescript
        const builder = new PreHubClientBuilder().host('localhost').port(1833);
    ```
2. Configure the device the client is running as.
    ```typescript
        const device: IDevice = {
            id: Guid.newGuid(),
            name: 'Barcode scanner #1',
            activity: Activity.Scan
        };
    ```
3. Connect to the Mqtt broker through the Prehub client.
4. 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.

---
_Source: https://npm.io/package/node-prehubclient · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
