1.2.10 • Published 3 years ago

ubidots-node v1.2.10

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Unofficial Ubidots NodeJS API Client

Node.js API Client for Ubidots

Prerequisites

  • Node.JS >=v8

Installation

npm install ubidots-node

Usage

Initializing Library:

const Ubidots = require('ubidots-node');
const client = Ubidots.create(Ubidots.ApiBase.Educational);

// Authorize API with an API Key
await client.authorize(API_KEY);
// or alternatively using a pre-generated API Token
client.token = API_TOKEN;

// Obtain UTC timestamp
const { data: now } = await ubitods
  .api('utils') // API namespace
  .endpoint('utc-timestamp') // API endpoint
  .call(); // Pass parameters/options/data

console.log('UTC Timestamp', now);

// Generate API token using API Key
const { data: token } = await ubitods
  .api('auth') // API namespace
  .endpoint('obtainToken') // API endpoint
  .call(apiKey = 'your-api-key'); // Pass parameters/options/data

console.log('API Token', token);

Available APIs:

Official API Documentation: https://ubidots.com/docs/sw/

For usage examples see test/ folder

Testing

UBIDOTS_API_KEY='xxxx' UBIDOTS_TOKEN='xxxx' npm test

Debugging

For debugging purpose the debug npm module is used.

Example of using the debug feature:

DEBUG='ubidots-node:*' npm test

Roadmap

  • Complete API definition
  • Add missing tests
  • Add payload validation
  • Find missing docs (Ubidots support?)
1.2.10

3 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago