Skip to main content

Prerequisites

You’ll need your Website’s clientId to initialize Supertab.js. If you haven’t created a Website yet, follow the guide Create Websites first. To find your Website’s clientId, log in to the Business Portal, navigate to Organization / Websites, then click the ”…” button next to your Website.

Quick Start

Choose an installation method based on your setup:

From npm

Install Supertab.js from npm for use with bundlers like Webpack, Vite, or Rollup:
npm install @getsupertab/supertab-js
Import, load and initialize the client in your application:
import { loadSupertab } from "@getsupertab/supertab-js";

(async () => {
    const { Supertab } = await loadSupertab();
    const supertabClient = new Supertab({ clientId: "test_client.X" });
})();
loadSupertab() loads the latest compatible Supertab.js version from our CDN. It must be called in a browser environment—it won’t work server-side.

Directly from CDN

Load Supertab.js directly from our CDN without a build step. Two options:

With an ES Module import

Use this method for modern browsers that support ES modules:
<script type="module">
    import { Supertab } from "https://js.supertab.co/v3/supertab.js";

    const supertabClient = new Supertab({ clientId: "test_client.X" });
</script>

With the global loader

Use this method for environments without ES module support. The script supertab.global.js exposes the global function window.loadSupertab():
<script src="https://js.supertab.co/v3/supertab.global.js"></script>
<script>
    (async () => {
        const { Supertab } = await window.loadSupertab();
        const supertabClient = new Supertab({ clientId: "test_client.X" });
    })();
</script>

Versioning

CDN URLs are versioned. Using v3 automatically loads the latest 3.x.x version (patch and minor releases). Breaking changes are released as new major versions.

Next Steps

Once installed, you can launch experiences or build custom purchase flows: