Launch an experience using Supertab.js
const supertabClient = new Supertab({clientId: "client.your_client"});
supertab.createPaygate
const supertabClient = new Supertab({ clientId: "test_client.abc" });
const supertabPaygate = await supertabClient.createPaygate({
experienceId: "experience.abc",
});
supertabPaygate.show()
createPaygate
accepts an object with the following properties:
Show StateSummary
null
if user has no prior entitlement.Show prior entitlement
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
missing
, expired
, valid
.null
otherwise.Show purchase object
"purchase.cf637646-71a4-430d-aaea-a66f1a48a83c"
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
"The Leek - 24 Hours Time Pass"
completed
, pending
, abandoned
.Show Entitlement status object
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
null
otherwise.Show offering object
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"24 Hours Time Pass to The Leek"
Show Entitlement details object
{length}{unit}
.Examples:{
// 1 year
"duration": "1y",
// 2 months
"duration": "2M",
// 3 weeks
"duration": "3w",
// 4 days
"duration": "4d",
// 5 hours
"duration": "5h",
// 6 minutes
"duration": "6m",
// 7 seconds
"duration": "7s"
}
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Show Tab object
null
value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.true
if payment was successful. false
otherwise.Show StateSummary
null
if user has no prior entitlement.Show prior entitlement
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
missing
, expired
, valid
.null
otherwise.Show purchase object
"purchase.cf637646-71a4-430d-aaea-a66f1a48a83c"
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
"The Leek - 24 Hours Time Pass"
completed
, pending
, abandoned
.Show Entitlement status object
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
null
otherwise.Show offering object
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"24 Hours Time Pass to The Leek"
Show Entitlement details object
{length}{unit}
.Examples:{
// 1 year
"duration": "1y",
// 2 months
"duration": "2M",
// 3 weeks
"duration": "3w",
// 4 days
"duration": "4d",
// 5 hours
"duration": "5h",
// 6 minutes
"duration": "6m",
// 7 seconds
"duration": "7s"
}
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Show Tab object
null
value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.true
if payment was successful. false
otherwise.Show ExperienceStateSummary
null
if user has no prior entitlement.Show prior entitlement
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
missing
, expired
, valid
.null
otherwise.Show purchase object
"purchase.cf637646-71a4-430d-aaea-a66f1a48a83c"
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
"The Leek - 24 Hours Time Pass"
completed
, pending
, abandoned
.Show Entitlement status object
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
null
otherwise.Show offering object
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"24 Hours Time Pass to The Leek"
Show Entitlement details object
{length}{unit}
.Examples:{
// 1 year
"duration": "1y",
// 2 months
"duration": "2M",
// 3 weeks
"duration": "3w",
// 4 days
"duration": "4d",
// 5 hours
"duration": "5h",
// 6 minutes
"duration": "6m",
// 7 seconds
"duration": "7s"
}
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Show Tab object
null
value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.true
if payment was successful. false
otherwise.Show ExperienceStateSummary
null
if user has no prior entitlement.Show prior entitlement
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
missing
, expired
, valid
.null
otherwise.Show purchase object
"purchase.cf637646-71a4-430d-aaea-a66f1a48a83c"
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
"The Leek - 24 Hours Time Pass"
completed
, pending
, abandoned
.Show Entitlement status object
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
null
otherwise.Show offering object
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"24 Hours Time Pass to The Leek"
Show Entitlement details object
{length}{unit}
.Examples:{
// 1 year
"duration": "1y",
// 2 months
"duration": "2M",
// 3 weeks
"duration": "3w",
// 4 days
"duration": "4d",
// 5 hours
"duration": "5h",
// 6 minutes
"duration": "6m",
// 7 seconds
"duration": "7s"
}
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Show Tab object
null
value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.true
if payment was successful. false
otherwise.supertab.createPurchaseButton
<div id="supertab-button-container"></div>
const supertabButton = supertabClient.createPurchaseButton({
containerElement: document.getElementById("supertab-button-container"),
experienceId: "experience.abc",
});
initialState
object and the object passed as an argument to the onDone
callback contain the following properties:
Show ExperienceStateSummary
null
if user has no prior entitlement.Show prior entitlement
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
missing
, expired
, valid
.null
otherwise.Show purchase object
"purchase.cf637646-71a4-430d-aaea-a66f1a48a83c"
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
"The Leek - 24 Hours Time Pass"
completed
, pending
, abandoned
.Show Entitlement status object
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
"2025-04-30T12:00:00Z"
"2025-04-30T12:00:00Z"
null
otherwise.Show offering object
"offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9"
"24 Hours Time Pass to The Leek"
Show Entitlement details object
{length}{unit}
.Examples:{
// 1 year
"duration": "1y",
// 2 months
"duration": "2M",
// 3 weeks
"duration": "3w",
// 4 days
"duration": "4d",
// 5 hours
"duration": "5h",
// 6 minutes
"duration": "6m",
// 7 seconds
"duration": "7s"
}
"site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Show Tab object
null
value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.true
if payment was successful. false
otherwise.const supertabButton = await supertabClient.createPurchaseButton({
containerElement: document.getElementById("supertab-button-container"),
experienceId: "experience.abc",
onDone: ({ priorEntitlement, purchase }) => {
if (priorEntitlement) {
// User has prior entitlement to the content.
return;
}
if (purchase) {
if (purchase.status === "completed") {
// Purchase was completed successfully.
} else {
// Purchase was not completed. User may have
// canceled the payment dialog if purchase
// required payment.
}
} else {
// User has canceled the flow and did not
// attempt to purchase the offering.
}
}
});