Client libraries and samples for connecting to IBM Watson IoT using nodejs
JavaScriptEPL-1.0
IBM Watson IoT Platform Javascript SDK
Installation
npm install @wiotp/sdk --save
Usage
Application
import{ApplicationClient,ApplicationConfig}from'@wiotp/sdk';letappConfig=ApplicationConfig.parseEnvVars();letappClient=newApplicationClient(appConfig);appClient.connect();// Do stuffappClient.disconnect();
Device
import{DeviceClient,DeviceConfig}from'@wiotp/sdk';letdeviceConfig=DeviceConfig.parseEnvVars();letdeviceClient=newDeviceClient(deviceConfig);deviceClient.connect();// Do stuffdeviceClient.disconnect();
Gateway
import{GatewayClient,GatewayConfig}from'@wiotp/sdk';letgwConfig=GatewayConfig.parseEnvVars();letgwClient=newGatewayClient(gwConfig);gwClient.connect();// Do stuffgwClient.disconnect();