For the complete documentation index, see llms.txt. This page is also available as Markdown.

Events

All events are dispatched on document as CustomEvent instances with bubbles: true. Listen with document.addEventListener or the convenience wrappers window.eliteBundle.on / window.eliteBundle.off.

window.eliteBundle.on('elite:byob:ready', (event) => {
  console.log(event.detail); // { bundleId, stepCount }
});

BYOB Events

elite:byob:ready

Fired once after BYOB finishes loading products from the Storefront API and React has mounted. This is the safe point to start reading window.eliteBundle.sdk.byob.

Detail:

{
  bundleId: string;   // Shopify product ID
  stepCount: number;  // number of configured steps
}

Example:

document.addEventListener('elite:byob:ready', (event) => {
  const { bundleId, stepCount } = event.detail;
  console.log(`Bundle ${bundleId} loaded with ${stepCount} steps`);

  const { steps } = window.eliteBundle.sdk.byob;
  renderMySteps(steps);
});

elite:byob:error

Fired when BYOB fails to load (e.g. Storefront API error, network failure).

Detail:

Example:


elite:byob:cart-change

Fired after every cart mutation: add, remove, or quantity update. Use this to keep your custom cart UI in sync.

Detail:

Example:


elite:byob:checkout-start

Fired when checkout() is called, before the cart POST request is sent.

Detail:

Example:


elite:byob:checkout-success

Fired after the cart POST request succeeds. If redirectTarget is "checkout" or "cart", the page navigates immediately after this event.

Detail:


elite:byob:checkout-error

Fired when the cart POST request fails.

Detail:

Example:


MOB Events

elite:mob:ready

Fired once after MOB finishes loading products and React has mounted. Safe point to start reading window.eliteBundle.sdk.mob.

Detail:

Example:


elite:mob:error

Fired when MOB fails to load.

Detail:


elite:mob:selection-change

Fired after any selection change: selectItem or setOptionSelection. Use this to update price displays and enable/disable the add-to-cart button.

Detail:

Example:


elite:mob:cart-add-start

Fired when addToCart() is called, before the cart POST request.

Detail:


elite:mob:cart-add-success

Fired after the cart POST request succeeds.

Detail:


elite:mob:cart-add-error

Fired when the cart POST request fails.

Detail:


Event timing

Both elite:byob:ready and elite:mob:ready can fire before your theme JavaScript runs, depending on load order. Always guard against this:

See Getting Started for the full guard pattern.

Last updated

Was this helpful?