Skip to content

varld-backup/changelog-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Changes Widget SDK

The widget sdk can be used to attach a changelog widget to an element, like a button. When the user clicks that element, a changelog-widget will pop up.
This SDK is powered by the Core SDK.

Useful Links

Installation

# npm
npm install changelog-widget

# yarn
yarn add 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.

Releases

No releases published

Packages

No packages published