2.0.0 • Published 1 year ago
obniz-cloud-sdk v2.0.0
obniz-cloud-sdk
を利用するための SDK です。
install
npm i obniz-cloud-sdk
Usage
// Type Script
import { getSdk } from 'obniz-cloud-sdk';
async function getDevices(token: string) {
const obnizAPI = getSdk(token);
const result = await obnizAPI.devices();
for (const edge of result.devices!.edges) {
const obniz = edge!.node!;
console.log(obniz.id);
console.log(obniz.description);
console.log(obniz.osVersion);
console.log(obniz.deviceLiveInfo?.isOnline);
break;
}
}
getDevices("token_XXXXXXXXXX")
// for javascript
const getSdk = require('obniz-cloud-sdk').getSdk;
async function getDevices(token) {
const obnizAPI = getSdk(token);
const result = await obnizAPI.devices();
for (const edge of result.devices.edges) {
const obniz = edge.node;
console.log(obniz.id);
console.log(obniz.description);
console.log(obniz.osVersion);
console.log(obniz.deviceLiveInfo?.isOnline);
break;
}
}
getDevices("token_XXXXXXXXXX")
2.0.0-beta.0
1 year ago
2.0.0
1 year ago
1.3.0-alpha.2
3 years ago
1.3.0-alpha.1
3 years ago
1.2.0-beta.1
4 years ago
1.2.0-beta.0
4 years ago
1.3.0-alpha.0
3 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.1.0
5 years ago