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'
   })

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