Core SDK

The Core SDK includes the fundamental building blocks for creating a changelog-embed-iframe, which can be mounted to another element.

The Core SDK is used in the widget as well as the sidebar.

Installation

npm install changelog-core

Usage

import CoreSDK from 'changelog-core';

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

// Delete the CoreSDK iframe
sdk.remove();

// Refresh the CoreSDK iframe
sdk.update();

// Access the iframe
sdk.iframe;

sdk.on('init', ...);
sdk.on('remove', ...);
sdk.on('update', ...);
sdk.on('loaded', ...);

API

new CoreSDK(options)

Create a new instance of a changelog-embed.

options

Type:

{
  id: string;
  key: string;
  mode?: string;
  options?: {
    embedHost?: string;
  }
}

sdk.remove()

Destruct a changelog-iframe.

sdk.remove()

Update the changelog-embed-iframe's contents.

sdk.on(event: string, cb: () => any)

Listen to internal events.

sdk.iframe: HTMLIframeElement

Access the changelog-embed-iframe.