Skip to main content


To initialize the Recharge JavaScript SDK, you will need to do it within the root of your theme (wherever the <head> element is located). Generally this tag is located in a file called theme.liquid.


Before using the SDK, make sure you have configured your bundle in the Recharge Bundle admin.


The object to represent a bundle looks like this:

"externalProductId": "7200062308549",
"externalVariantId": "41291293425861",
"selections": [
"collectionId": "285790863557",
"externalProductId": "7200062308549",
"externalVariantId": "41504991412421",
"quantity": 2
"collectionId": "288157827269",
"externalProductId": "7200061391045",
"externalVariantId": "41510929465541",
"quantity": 2

Bundle Object

externalProductIdstringShould match the Shopify Product ID of the Bundle Product
externalVariantIdstringShould match the Shopify Variant ID of the Bundle Product
selectionsarrayHas the contents of the bundle. The items here must respect the rules that are configured in the bundle

Selections Object

collectionIdstringThe Shopify Collection ID where the selected product is included
externalProductIdstringThe Shopify Product ID of the selected product
externalVariantIdstringThe Shopify Variant ID of the selected product
quantitynumberThe number of items of this product

Subscription attributes

In case you want to create the bundle as a subscription, you will need to add the following optional attribute to the selections of the bundle:

sellingPlanIdnumberThis is the ID of the selling plan that you want to associate this product with


Load the JavaScript SDK script, and then initialize it with your store domain:

<!-- Rest of your code -->
<script src=""></script>
// This should be your domain
storeIdentifier: '{{shop.permanent_domain}}',