botbar
Frameworks

HTML and JavaScript

The script tag, and rendering from your own code.

Automatic

Any element with the class botbar-widget becomes a widget when api.js loads. Options are data- attributes; see the widget reference.

Explicit

Load the script with ?render=explicit and render when you're ready:

<script src="https://api.example.com/v1/api.js?render=explicit&onload=ready" async defer></script>
<script>
  function ready() {
    const id = botbar.render("#checkout-botbar", {
      sitekey: "site_...",
      action: "checkout",
      callback: (token) => enablePayButton(),
      expiredCallback: () => disablePayButton(),
    });
  }
</script>

botbar.reset(id), botbar.remove(id) and botbar.getResponse(id) do what they say.

On this page