/iot-nodejs

Client libraries and samples for connecting to IBM Watson IoT using nodejs

Primary LanguageJavaScriptEclipse Public License 1.0EPL-1.0

IBM Watson IoT Platform Javascript SDK

Build Status Coverage Status GitHub issues GitHub

Installation

npm install @wiotp/sdk --save

Usage

Application

import {ApplicationClient, ApplicationConfig} from '@wiotp/sdk';

let appConfig = ApplicationConfig.parseEnvVars();
let appClient = new ApplicationClient(appConfig);
appClient.connect();
// Do stuff
appClient.disconnect();

Device

import {DeviceClient, DeviceConfig} from '@wiotp/sdk';

let deviceConfig = DeviceConfig.parseEnvVars();
let deviceClient = new DeviceClient(deviceConfig);
deviceClient.connect();
// Do stuff
deviceClient.disconnect();

Gateway

import {GatewayClient, GatewayConfig} from '@wiotp/sdk';

let gwConfig = GatewayConfig.parseEnvVars();
let gwClient = new GatewayClient(gwConfig);
gwClient.connect();
// Do stuff
gwClient.disconnect();

Development

Build

npm i
npm run build

Publish

npm login
npm publish .