Set up Add-ons with Rebilly Instruments

This topic describes how to set up add-ons for use with the Rebilly Instruments JavaScript library.

Important
Add-ons only works together with the items property

Add-ons setup

If you have not already done so, complete the basic setup tutorial.

The add-ons will show up at the bottom of the confirmation screen.

JavascriptHTML
Copy
Copied
import RebillyInstruments from '@rebilly/instruments';

RebillyInstruments.mount({
  organizationId: 'test-org-2019-12-07',
  publishableKey: 'pk_sandbox_WcUZLs3xwB7dubewna3zJA75wdMBEHeWHOyQww8',
  websiteId: 'ach-example',
  apiMode: "sandbox",
  items: [
    {
      planId: 'my-plan-id',
      quantity: 1
    },
  ],
  addons: [
    {
      planId: 'my-addon-plan-id',
      quantity: 1
    },
  ],
});
Copy
Copied
<html>
  <body>
    <div id="app">
      <div class="form-wrapper">
        <section class="rebilly-instruments-summary"></section>
        <section class="rebilly-instruments"></section>
      </div>
    </div>
  </body>
</html>