> For the complete documentation index, see [llms.txt](https://docs.elitebundleapp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elitebundleapp.com/reference/globals.md).

# Global Object

The top-level object injected on every bundle product page.

```ts
window.eliteBundle = {
  version: string;
  app:  EliteBundleApp;
  byob: BundleData | null;   // null on MOB-only pages
  mob:  BundleData | null;   // null on BYOB-only pages
  sdk?: {
    byob: ByobSDKState | null;
    mob:  MobSDKState  | null;
  };
  on(event: string, cb: EventListener): void;
  off(event: string, cb: EventListener): void;
}
```

`sdk` is only present when SDK access is enabled in the app settings. Always check `window.eliteBundle?.sdk` before accessing it.

***

## `app`

Shop-level globals. Set synchronously by the Liquid theme extension before any JavaScript runs. `currencyRate` is added by the bundle script after it loads.

| Field                   | Type                                 | Description                                                                                  |
| ----------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------- |
| `shopDomain`            | `string`                             | Store myshopify domain, e.g. `"store.myshopify.com"`                                         |
| `moneyFormat`           | `string`                             | Shopify money format string, e.g. `"${{amount}}"`                                            |
| `currencyCode`          | `string`                             | ISO 4217 currency code, e.g. `"USD"`                                                         |
| `currencyRate`          | `number`                             | Exchange rate from shop base currency to buyer's active currency. `1.0` means same currency. |
| `storefrontAccessToken` | `string \| null`                     | Storefront API access token. Use this if you need to make Storefront API calls yourself.     |
| `cartTransformCreated`  | `boolean`                            | Whether the bundle cart transform Shopify Function is active.                                |
| `bundleDiscountCreated` | `boolean`                            | Whether the bundle discount Shopify Function is active.                                      |
| `webPixelCreated`       | `boolean`                            | Whether the analytics web pixel is active.                                                   |
| `bundleRenderMode`      | `"product_page" \| "dedicated_page"` | How the bundle renders on the storefront.                                                    |
| `sdkEnabled`            | `boolean`                            | Whether SDK access is enabled.                                                               |

```js
const { shopDomain, moneyFormat, currencyCode, storefrontAccessToken } = window.eliteBundle.app;
```

***

## `byob` / `mob`

Raw data injected by the Liquid theme extension. Available synchronously on page load, before React mounts. `null` when that bundle type is not on the current page.

| Field              | Type                       | Description                                                                       |
| ------------------ | -------------------------- | --------------------------------------------------------------------------------- |
| `templateData`     | `object`                   | Puck editor state (the visual template JSON). Not typically needed in custom UIs. |
| `bundleConfig`     | `object`                   | Full bundle configuration: steps, products, discount settings.                    |
| `shopifyVariantId` | `number \| string \| null` | Shopify variant ID of the bundle product.                                         |
| `productId`        | `string`                   | Shopify product ID. Stable identifier for this bundle.                            |

```js
const { productId, bundleConfig } = window.eliteBundle.byob;
console.log(bundleConfig.steps.length); // number of steps
```

***

## `on` / `off`

Convenience wrappers around `document.addEventListener` / `document.removeEventListener`.

```js
function handleCartChange(event) {
  const { cart, cartTotal, canCheckout } = event.detail;
  updateMyCartUI(cart);
}

window.eliteBundle.on('elite:byob:cart-change', handleCartChange);

// Later, to clean up:
window.eliteBundle.off('elite:byob:cart-change', handleCartChange);
```

See [Events Reference](/reference/events.md) for all available events.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.elitebundleapp.com/reference/globals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
