Launchbase JavaScript SDK

The JavaScript SDK allows you to open the Launchbase widget in any JavaScript application, with any framework.

1. Install Launchbase using NPM

Navigate to your project's folder and type one of the following commands.
npm install @launchbase/core
# or using yarn
yarn add @launchbase/core

2. Access the Launchbase SDK

Set up your project

Before being able to open the Launchbase Widget, you have to set up your project.
import launchbase from '@launchbase/core'
launchbase.setup({
integrationKey: '{{integrationKey}}'
});
Please make sure to replace {{ integrationKey }} with your project's integration key, which can be found in the integration section of the Launchbase dashboard.

Open the widget

Please only open the widget after the user has performed an action, like clicking a button.
import launchbase from '@launchbase/core'
// when you want to open the widget
launchbase.open();

Close the widget

import launchbase from '@launchbase/core'
// when you want to close the widget
launchbase.close();

Toggle the widget

import launchbase from '@launchbase/core'
// when you want to close the widget
launchbase.toggle();