@lightelligence/browser-sdk

0.6.1 • Public • Published
logo

BrowserSDK

Build Status Code Coverage Dependencies npm (scoped)

The Lightelligence API JavaScript Client for the Browser

Installation

npm install @lightelligence/browser-sdk

Features

The BrowserSDK allows you to access most of the Lightelligence API end-points and manages the user authentication flow for your client side application.

Usage

In order to authenticate with the BrowserSDK you will need to create an application via our Lightelligence portal and obtain a public client ID.

import BrowserSDK, { Device } from '@lightelligence/browser-sdk';

const browserSDK = new BrowserSDK({
  environment: 'prod', // Target enviroment (either `dev`, `preview` or `prod`)
  clientId: '', // The public client ID of the application your created in our [Lightelligence portal](https://portal.lightelligence.io/developer)
});

browserSDK.getCurrentUser().then(user => {

  if ( !user ) { return browserSDK.login(); }
  
  // Will print all devices of the tenant
  Device.getDevices().then( devices => console.log( devices ) );
  
} )

Check out the API reference to see the full documentation.

License

MIT

Package Sidebar

Install

npm i @lightelligence/browser-sdk

Weekly Downloads

15

Version

0.6.1

License

MIT

Unpacked Size

1.37 MB

Total Files

76

Last publish

Collaborators

  • m.grunwald.osram.com
  • rfunke
  • lightelligence-team