1.0.0 • Published 4 years ago

nanoleaf.js v1.0.0

Weekly downloads
6
License
SEE LICENSE IN LI...
Repository
github
Last release
4 years ago

nanoleaf.js

A typesafe, unopinionated Nanoleaf client for Node

 _____________
< nanoleaf.js >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |

Usage

Get the IP of your Nanoleaf product via your router's Admin panel, then use yarn authorization or npm run authorization to get your authorization token.

Constructor Options

host: string; // IP address of Nanoleaf product
token: string; // Authorization token from Nanoleaf product
port?: number; // Defaults to 16021
base?: string; // Defaults to /api/v1

TypeScript

import { NanoleafClient } from 'nanoleaf.js';

const client = new NanoleafClient({
  host: 'Nanoleaf IP address',
  token: 'Authorization token',
});

client.turnOff().then(console.log);

JavaScript

const nanoleaf = import('nanoleaf.js');

const client = new nanoleaf.NanoleafClient({
  host: 'Nanoleaf IP address',
  token: 'Authorization token',
});

client.turnOff().then(console.log);