> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lantern.is/llms.txt
> Use this file to discover all available pages before exploring further.

# Window (Javascript)

> An overview of the global window.lantern object for interacting with Lantern on the storefront.

The `window.lantern` object is a global JavaScript object available on your Shopify theme when the Lantern app is installed and active. It serves as the primary interface for interacting with Lantern from the storefront.

## Accessing the `window.lantern` Object

You can access the `window.lantern` object directly from any script running on your storefront.

```js theme={null}
if (window.lantern) {
  console.log('Lantern is available!', window.lantern);
}
```

<Info>
  The `window.lantern` object is initialized asynchronously. Listen for the `lantern:loaded` event before using its properties.
</Info>

```js theme={null}
window.addEventListener('lantern:loaded', () => {
  console.log('Lantern is now fully loaded and ready to use.');
  // You can now safely use window.lantern properties
  const customer = window.lantern.customer;
});
```
