The Fondue Cashback SDK enables seamless integration of cashback functionality into your Shopify e-commerce platform. Once integrated, it exposes methods on the window.Fondue
object to track cart events, apply promotions, and more.
To install the SDK, insert the following script in the <head>
section of your HTML:
<script
async
id="fondue-cashback"
src="<https://public.getfondue.com/cashback-extension/cart/fundle.js>"
type="application/javascript"
shop="[YOUR_SHOP]"
api="[AJAX_OR_STOREFRONT]">
</script>
[YOUR_SHOP]
: Your shop’s unique identifier
Example: amazing-shop.myshopify.com
[AJAX_OR_STOREFRONT]
: The API you use
AJAX
for Shopify's cart.js
STOREFRONT
for Shopify’s Storefront APICheck the SDK status using:
if (window.Fondue.status === "ready") {
// SDK is ready to use
}
This ensures that you only call SDK methods when it's fully loaded and available.
To fetch cart contents and apply cashback correctly, the SDK needs to know which cart belongs to the current customer.
You must implement both of the following: