Skip to main content

How to Install

There are two ways to install the Onset widget:
  1. Using the NPM package
  2. Using the embed script
Both methods give you access to the same widget API.

1. Install via NPM

1

Install the Onset widget package

npm install @onset/widget
2

Create a widget client instance

import { createOnsetWidget } from "@onset/widget";

const widget = createOnsetWidget({
  page: 'PAGE_DOMAIN',
});
3

Use the instance

You can now control the widget using the exposed methods.
widget.openWidget();
widget.closeWidget();
Refer to the Methods section for the full API.

2. Install via Embed Script

1

Copy the embed snippet

Go to your Onset Dashboard -> Settings -> Widget and copy the provided <script> snippet. Paste it into your site’s HTML, right before the closing </body> tag.
2

Use the global instance

The embed script exposes a global onsetWidget instance.
widget.openWidget();
widget.closeWidget();

Troubleshooting

Check the following:
  • The script snippet or NPM import is included on every page where the widget should load.
  • page domain is correct.
This means the embed script did not load.Verify that the <script> tag is placed before the closing </body> tag, not in the <head>.
Usually caused by initialization issues.Make sure the widget is created before calling its methods.
Double-check the page domain in:
  • The NPM initialization config
  • The embed snippet you copied from the dashboard
Page domain is a URL to your public onset release notes page without the https://Examples:
example.onset.io - Onset page domain
releases.example.com - Custom domain page