# isobarot-client

> Client library for sending data to isobarot cloud over HTTP or MQTT.

Latest version **1.2.0** (published 2022-07-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install isobarot-client
pnpm add isobarot-client
yarn add isobarot-client
bun add isobarot-client
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-07-06 |
| First published | 2022-03-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | bjelicaluka |
| Maintainers | bjelicaluka |

## Links

- npm: https://www.npmjs.com/package/isobarot-client
- npm.io page: https://npm.io/package/isobarot-client

## Dependencies (2)

- [mqtt](https://npm.io/package/mqtt.md) ^4.3.7
- [axios](https://npm.io/package/axios.md) ^0.26.1

## Recent versions

- 1.2.0 (latest) — 2022-07-06
- 1.1.1 — 2022-04-18
- 1.1.0 — 2022-04-18
- 1.0.2 — 2022-03-31
- 1.0.1 — 2022-03-31
- 1.0.0 — 2022-03-31

## README

# isobarot-client

- Client library for sending data to isobarot cloud over HTTP or MQTT.

## Getting Started

```sh
npm install --save isobarot-client
```

## HttpClient Example

```js
const { HttpClient } = require("isobarot-client");
const httpClient = new HttpClient(`app.isobarot.com`);

httpClient.send({
  apiToken: "<api-token-here>",
  createdAt: "2022-03-31T12:22:12.000Z",
  record: {
    // properties here
  }
})
.then(response => console.log(response.data))
.catch(error => console.log(error.response.data));
```

## MqttClient Example

```js
const { MqttClient } = require("isobarot-client");
const mqttClient = new MqttClient(`app.isobarot.com`);

mqttClient.init()
// Connection to the MQTT Broker success
.then(() => {
  // Send the data
  mqttClient.send({
    apiToken: "<api-token-here>",
    createdAt: "2022-03-31T12:22:12.000Z",
    record: {
      // properties here
    }
  });
  // Send the data with QoS and Retain options
  mqttClient.send({
    apiToken: "<api-token-here>",
    createdAt: "2022-03-31T12:22:12.000Z",
    record: {
      // properties here
    }
  }, {
    qos: 2,
    retain: true
  });
  // Subscribe to topic
  mqttClient.subscribe('some/topic', data => {
    console.log(data);
  });
})
// Connection to the MQTT Broker failed
.catch(error => {
  console.log(error);
  // Close connection
  mqttClient.close();
});
```

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