Skip to main content
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.
if (window.lantern) {
  console.log('Lantern is available!', window.lantern);
}
The window.lantern object is initialized asynchronously. Listen for the lantern:loaded event before using its properties.
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;
});