Skip to main content
Supertab.js makes it simple to embed powerful monetization flows into your Website. This guide will walk you through launching experiences and what information you receive about choices your customers make when interacting with a Supertab experience.

Before You Begin

Make sure that you have:

Initialize the Supertab.js Client

First, create a new Supertab instance using your client ID.
Replace client.your_client with the live or test client ID associated with Website you created when setting up your experiences. Supertab.js uses this client ID to make sure its running in the correct place.

Display a Paywall

The Paywall is a customizable experience that handles login, entitlement checks and purchase flows for you. You can launch it any time: on page load, after a user action or in response to app logic.
Quickstart

Options for createPaywall

Offerings available for sale, messaging text and styling are controlled from the Business Portal

PaywallExperienceResult

createPaywall returns a PaywallExperienceResult object containing the initial state of the Paywall and methods for showing it to users.

Paywall Lifecycle

The state of the Paywall is generally returned to you as a promise which resolves when the Paywall exits. The Paywall may exit as a result of a successful purchase or as a result of user abandonment. Supertab Experiences uses an async programming paradigm. Each interaction returns a promise which resolves once the user has finished interacting with the Paywall. You can handle these promises through the use of async / await or through promise chaining with .then().
Examples on this page use async / await.

Checking for Purchases

The experience state will tell you if your user made a purchase from the paywall. You can find detail about any purchase the user made by inspecting the purchase field.
Check for a purchase

Check For Prior Entitlement (Optional)

You may wish to check for any prior entitlement your user has purchased without immediately showing the paywall. This is achieved by inspecting the initial state of the paywall immediately after creating it. EntitlementStatus contains information on which contentKeys the user has an entitlement for and when their entitlement expires.
Prior Entitlements
You may also check for entitlements after the paywall has exited by inspecting the priorEntitlement field of the resolves ExperienceStateSummary object.

Force LogIn (Optional)

It is only possible to check for prior entitlements without starting the paywall experience when the user is already logged in. You can force an immediate login by calling logIn on the paywall itself.
Force Login
Because .logIn() immediately opens a popup it should only be called in response to a user action.

Wrapping Up

We’ve covered:
  • How to create and show a paywall
  • The lifecycle of the paywall and its async programming model
  • How to work with the state of the paywall to check for purchases and entitlements