changelog-widget
v0.0.7-beta
Published
- [Why keep a changelog](https://changes.blue/guide/why/changelog) - [How to keep a good changelog](https://changes.blue/guide/howto/changelog) - [Using the widget](https://changes.blue/guide/client/widget) - [How to use Changes in React](https://changes.
Downloads
13
Readme
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.