Articles on: Apps integration

Reelfy JavaScript API Documentation

What is the reelfy JavaScript API?

JavaScript API documentation explains how to use various JavaScript events and methods in Shopify shops, which have the reelfy app installed.

When the reelfy app gets loaded

When the reelfy app gets loaded, reelfy automatically triggers the reelfyLoaded event.
Here is how you can configure a listener for said event:

// This event will be fired whenever the reelfy app is loaded
document.addEventListener('reelfyLoaded', function(event) {
    // Do your magic :) 
});

This event will be fired whenever a gallery is rendered

When the reelfy app gets created, reelfy automatically triggers the reelfyCreated event.
Here is how you can configure a listener for said event:

// This event will be fired whenever the reelfy app is created
document.addEventListener('reelfyCreated', function(event) {
    // Do your magic :) 
});

When product is added to the cart from the reelfy

When the After the product gets added to the cart, our reelfy app automatically triggers the following reelfyCartAdded event.
Here is how this event is triggered:

// This is how the event is triggered
document.dispatchEvent(new CustomEvent("reelfyCartAdded", { 
	detail: {
		cartDetail: response, 
		form: form, 
		cart: cart, 
		formID: formID
	}
}));

And here is how you can configure a listener for said event:

// This is how you can configure a listener for said event
document.addEventListener('reelfyCartAdded', function(event) {
    // Do your magic :) 
});

Updated on: