Getting Started
Checkout Integration Script
Put the below script before your website's closing head tag </head>
.
HTML
<script>
(function (d, o, s, a, m) {
a = d.createElement(o);
m = d.getElementsByTagName(o)[0];
a.async = 1;
a.defer = 1;
a.src = s;
m.parentNode.insertBefore(a, m);
})(document, "script", "https://embed.subsbase.com/sb.min.js");
window.sb =
window.sb ||
function () {
(sb.s = sb.s || []).push(arguments);
};
sb("siteId", "{your_siteId}"); // Required
sb("theme", "{hex-code}"); // Optional. example: sb('theme', '#20407d')
sb("callback", (e) => console.log("signup result:", { e })); //Optional
sb(
"attachPlan",
"{planCode}",
"{clickableElementReference}",
["class|id"],
["{attachEvent}"]
); //At least one is required. can be repeated
sb("queryParam", "{param}", "{value}"); // Optional. can be repeated.
</script>
Plan Picker Integration Script
Put the below script before your website's closing head tag </head>
.
HTML
<script>
(function (d, o, s, a, m) {
a = d.createElement(o);
m = d.getElementsByTagName(o)[0];
a.async = 1;
a.defer = 1;
a.src = s;
m.parentNode.insertBefore(a, m);
})(document, "script", "https://embed.subsbase.com/sb.min.js");
window.sb =
window.sb ||
function () {
(sb.s = sb.s || []).push(arguments);
};
sb("siteId", "{your_siteId}"); // Required
sb("attachPlanPicker", "{config}"); // Required, Only once or unexpected behavior may occur.
</script>
For more details you can check the Embedding Checkout page.
Table of Contents