Skip to content

Web Integration

Hubble Checkout’s web SDK is a Javascript sdk that can be integrated by a simple 2-step process

Step 1 - Add SDK source script

index.html
<head>
...
<script src="https://assets.myhubble.money/web-sdk/hubble-web-sdk-0.3.0.min.js"></script>
</head>

Step 2 - Initialize the plugin

Once the plugin source is pulled, you initialise the plugin by using the below code snippet.

index.html
<script>
Hubble.setOptions({
env: 'dev' // If not given, will default to 'prod'
token: 'GOpBKIQ0xj', // Some token or ID that uniquely identifies your user
clientId: 'clientA', // will be provided by Hubble team
clientSecret: 'clientSecretA', // will be provided by Hubble team
style: {
zIndex: 1000, // will default to 10
}
})
</script>

Step 3 - Open the plugin

When the plugin is opened, the webpage simply needs to call Hubble.checkout(brandKey) to open Amazon checkout.

<input type="button"
value="Gift cards"
onclick="openHubble()" />
function openHubble() {
// Checkout function takes in brand_key of the brand whose checkout needs to be opened
// We will share brand keys with the partners through other channels, post activation of brands
Hubble.checkout("zomato");
}

Changelog

VersionDateChangesBy
0.0.1First versionSudhagar
0.1.08-Apr-2024Move denominations inside amount conditionsSudhagar
0.1.19-Apr-2024Support options to supply header image logo and href urlsSudhagar
0.2.012-Apr-2024Open the checkout as a modal so that partner’s page structure is intactSudhagar
0.2.117-Apr-2024Add a loader that shows up till checkout page is loadedSudhagar
0.3.018-Apr-2024Support opening checkout of any brand by taking in brand keySudhagar
0.3.119-Apr-2024Support taking in a zIndex for the SDK viewSudhagar