@apio/sdk
TypeScript icon, indicating that this package has built-in type declarations

2.1.4 • Public • Published

@apio/sdk

NodeJS SDK for Apio IoT Platform.

Installation

npm i @apio/sdk

Usage

import Sdk, { Device } from '@apio/sdk'

const sdk = Sdk.create({
  uri: 'platform-uri',
  apiKey: 'your-api-key',
  projectId: 'your-project-id'
})

async function main () {
  try {
    const devices: Device[] = await sdk.device.findAll()
    console.log(devices)
  } catch (e) {
    console.error(e)
  }
}

main()

Cache

Sdk support Cache strategy. For enable it set cache property in configuration:

const sdk = Sdk.create({
  uri: 'platform-uri',
  apiKey: 'your-api-key',
  projectId: 'your-project-id'
  cache: true // For default configuration. Otherwise: { ttl: number }
})

Package Sidebar

Install

npm i @apio/sdk

Weekly Downloads

257

Version

2.1.4

License

MIT

Unpacked Size

54 kB

Total Files

51

Last publish

Collaborators

  • gprovinciali
  • fatmatto
  • matteodisabatino