> ## 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.

# Overview

> Access Lantern loyalty data in your Shopify themes using the Liquid templating language

Lantern stores all customer loyalty data as Shopify [metafields](https://help.shopify.com/en/manual/custom-data/metafields) and [metaobjects](https://help.shopify.com/en/manual/custom-data/metaobjects), making it accessible through Shopify's Liquid templating language. This allows you to build custom loyalty experiences directly in your theme.

<Info>
  All data is automatically updated by Lantern and cached for optimal storefront performance.
</Info>

## Available Metafields

The following metafields are available for accessing Lantern data:

### Customer Profile

| Field                                                        | Description                     | Example Value                                                        |
| ------------------------------------------------------------ | ------------------------------- | -------------------------------------------------------------------- |
| [`activity_feed`](/docs/storefront/liquid-api/activity-feed) | Recent customer activity events | Loyalty actions, purchases, referrals                                |
| [`birth_date`](/docs/storefront/liquid-api/birth-date)       | Customer's birthday             | `"1989-12-13"`                                                       |
| [`is_tester`](/docs/storefront/liquid-api/is-tester)         | Test account flag               | Hide from analytics, enable debug features                           |
| [`properties`](/docs/storefront/liquid-api/properties)       | Custom customer properties      | `{"favorite_category": "electronics"}`                               |
| [`wallet`](/docs/storefront/liquid-api/wallet)               | All available rewards & credits | Active discounts, gift cards, product rewards, store credit balances |
| [`wishlist`](/docs/storefront/liquid-api/wishlist)           | Customer's wishlist items       | Array of product variant GIDs                                        |

### Loyalty Program

| Field                                                          | Description                | Example Value |
| -------------------------------------------------------------- | -------------------------- | ------------- |
| [`loyalty_tier`](/docs/storefront/liquid-api/loyalty-tier)     | Current tier name          | `"Gold"`      |
| [`loyalty_points`](/docs/storefront/liquid-api/loyalty-points) | Available points balance   | `1250`        |
| [`loyalty_spend`](/docs/storefront/liquid-api/loyalty-spend)   | Current period spend       | `249.99`      |
| [`is_eligible`](/docs/storefront/liquid-api/is-eligible)       | Can participate in loyalty | `true`        |
| [`is_blocked`](/docs/storefront/liquid-api/is-blocked)         | Blocked from rewards       | `false`       |

### Referral Program

| Field                                                        | Description             | Example Value   |
| ------------------------------------------------------------ | ----------------------- | --------------- |
| [`referral_code`](/docs/storefront/liquid-api/referral-code) | Unique referral code    | `"6b577dd5288"` |
| [`is_advocate`](/docs/storefront/liquid-api/is-advocate)     | Has referred others     | `true`          |
| [`is_referred`](/docs/storefront/liquid-api/is-referred)     | Joined through referral | `true`          |

## Usage Example

All Lantern metafields are accessed through the `customer.metafields` object in Liquid. Most use the `lantern` namespace.

```liquid theme={null}
{% assign points = customer.metafields.lantern.loyalty_points %}
{% assign tier = customer.metafields.lantern.loyalty_tier %}

{% if points and tier %}
  <div class="loyalty-status">
    <h3>Welcome {{ tier | capitalize }} Member!</h3>
    <p>You have {{ points }} points available</p>
  </div>
{% endif %}
```

## Authentication

Metafields are only available for logged-in customers. When a customer is not logged in, all metafields will return `null` or be undefined.

Learn more about [accessing metafields in Liquid on Shopify](https://shopify.dev/docs/api/liquid/objects/metafield).
