thingspro-cloud-sdk
v0.2.20
Published
An API wrapper for the ThingsPro Cloud
Downloads
29
Readme
ThingsPro Cloud SDK for Node.js
An API wrapper for the ThingsPro Cloud API.
Installation
yarn add thingspro-cloud-sdk
Getting started
Import the module and create a new client. Passing api urls is optional if you need call private cloud service.
const tpc = require('thingspro-cloud-sdk')()
// Optional: change the api server url
tpc.setServerUrl({
admin: 'https://api.thingsprocloud.com/admin-api/v1',
dsc: 'https://api.thingsprocloud.com/dsc/v1',
dlm: 'https://api.thingsprocloud.com/api/v1',
rtm: 'https://api.thingsprocloud.com/rtm/v1',
pic: 'https://pic.thingsprocloud.com/api/v1',
dsr: 'https://repo.thingsprocloud.com/api/v1'
})
// login dlm with email and password
await tpc.dlm().login('[email protected]', 'your_password')
// get logged in user profile
console.log(tpc.dlm().me)
// get all projects
console.log((await tpc.dlm().project.get())