Rebuy triggers lifecycle events in order to allow developers to provide additional functionality. Below are the two main overarching events from Rebuy.JS. There are many more events that are specific to the Cart, Smart Cart and widgets which can be found in the respective section of the doc's.

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