thingspro-cloud-sdk

0.2.20 • Public • Published

ThingsPro Cloud SDK for Node.js

Build Status NPM

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('guest@thingsprocloud.com', 'your_password')

// get logged in user profile
console.log(tpc.dlm().me)

// get all projects
console.log((await tpc.dlm().project.get())

Table of Contents

Package Sidebar

Install

npm i thingspro-cloud-sdk

Weekly Downloads

8

Version

0.2.20

License

ISC

Unpacked Size

66.2 kB

Total Files

59

Last publish

Collaborators

  • thingspro-cloud-dev
  • thingspro.ci