Event Listeners

Rebuy triggers lifecycle events in order to allow developers to provide additional functionality. Below are the two main overarching events from Rebuy.JS.

Before Load

This triggers before Rebuy loads.

document.addEventListener('rebuy.beforeLoaded', (event) => {
    console.log('rebuy.beforeLoaded');
});

Loaded

This triggers when Rebuy has fully loaded.

document.addEventListener('rebuy.loaded', (event) => {
    console.log('rebuy.loaded');
});



There are additional events specific to the Cart, Smart Cart, and widgets, which can be found in their respective sections of the documentation or through the links below.