Widget SDK

The widget SDK empowers you to add a changelog widget to your own website.

This widget can be attached to any element.

Installation

npm install changelog-widget

Usage

import Widget from 'changelog-widget';

// Instantiate the Widget
let sdk = new Widget({
  id: '5Web2XRF',
  key: 'IK-X2zvTYjp-NCg-3q2Rj'

  // The element the widget should be mounted to
  element: document.querySelector('.my-button')
});

// Toggle the widget
sdk.toggle();

// Open the widget
sdk.open();

// Close the widget
sdk.close();

API

new WidgetSDK(options)

Create a new widget-instance.

options

Type:

{
  id: string;
  key: string;
  element: string;
}

sdk.open()

Open the widget programmatically.

sdk.close()

Close the widget programmatically.

sdk.toggle()

Open or close the widget programmatically.