Skip to content

ALLOcloud/allocloud-js-sdk

Repository files navigation

ALLOcloud JavaScript SDK

An isomorphic/universal promise based interface to the ALLOcloud API.

CircleCI npm

Documentation

Install

$ yarn add @allocloud/js-sdk
# or with NPM
$ npm install --save @allocloud/js-sdk

Usage

import ALLOcloud from "@allocloud/js-sdk";

const API_KEY = process.env.ALLOCLOUD_API_KEY;

const main = async () => {
  const client = await ALLOcloud.create(API_KEY);

  const devices = await client.listDevices();
  const deviceThree = await client.getDevice(3);
  const contacts = await client.listContacts();

  console.log("Devices count:", devices.length);
  console.log("Contacts count:", contacts.length);
  console.log("Device (id: 3) name:", deviceThree.name);

  const newCalendar = {
    name: "My super new calendar",
    is_external_calendar: false,
    ics: "BEGIN:VCALENDAR\nVERSION:2.0\n{ICS_DATA_HERE}\nEND:VCALENDAR",
    url: "",
    time_zone: "Europe/Brussels"
  };

  const calendar = await client.createCalendar(newCalendar);
  console.log("New calendar created. id:", calendar.id);
};

main();

About

An isomorphic/universal promise based interface to the ALLOcloud API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •