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.
# npm
npm install changelog-widget
# yarn
yarn add changelog-widget
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();
Create a new widget-instance.
Type:
{
id: string;
key: string;
element: string;
}
Open the widget programmatically.
Close the widget programmatically.
Open or close the widget programmatically.