Events
subify:sdkLoaded
This event will be triggered when sdk is successfully loaded.
window.addEventListener("subify:sdkLoaded",()=>{
//sdk is loaded and you can access to 'window.subifySdk'
})
Please note that this event is only triggered when the Subify SDK has not yet been loaded. If you listen to this event after the Subify SDK has been loaded, it won't be triggered. You can check “window.subifySdk” to determine whether the SDK has been loaded previously.
subify:variantChange
This event will be triggered when sdk detects variant selection.
window.addEventListener("subify:variantChange", (event) => {
//you have access targetProductId and selectedVariantId in event.detail
const { targetProductId, selectedVariantId } = event.detail;
});
event.detail
targetProductId
(number) The ID of the product whose variant has changed.
selectedVariantId
(number) the ID of new selected variant
subify:sellingPlanChange
This event will be triggered when the user changes a subscription option in the widget.
window.addEventListener("subify:sellingPlanChange", (event) => {
//you have access targetProductId and selectedSellingPlan in event.detail
const {targetProductId, selectedSellingPlan } = event.detail;
});
event.detail
targetProductId
(number) The ID of the product whose selling plan has changed.
selectedSellingPlan
Selected selling plan that is a Shopify selling plan object or null if the user selects one time purchase option
Last updated