Skip to content
On this page

Usage

The Widget SDK provides multiple modules that you can import and use in your application. There is currently a CommonJS module, an ES module, an AMD module, and a UMD module that you can use depending on your build process.

CommonJS module

A CommonJS module is exported by this package and available by requiring @stakeholderlabs/roundtable-sdk. Require this module and build your project with a build tool that supports CommonJS modules.

js
const roundtableSdk = require('@stakeholderlabs/roundtable-sdk');

const campaignSlug = '<CAMPAIGN UNIQUE SLUG FROM THE ROUNDTABLE>';

const widget = new roundtableSdk.Widget(campaignSlug, '<WIDGET CONTAINER SELECTOR>', {
  // additional SDK settings
});

ES Module

An ES module is exported by this package and available by importing @stakeholderlabs/roundtable-sdk. Import this module and build your project with a build tool that supports ES modules (such as webpack).

js
import * as RoundtableSdk from '@stakeholderlabs/roundtable-sdk';

const campaignSlug = '<CAMPAIGN UNIQUE SLUG FROM THE ROUNDTABLE>';

const widget = new RoundtableSdk.Widget(campaignSlug, '<WIDGET CONTAINER SELECTOR>', {
  // additional SDK settings
});

This is how the widget should look after adding it to the page

Verification Button Widget