> For the complete documentation index, see [llms.txt](https://docs.getpurpledot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront.md). Agents can also search and read this documentation through its [MCP server](https://docs.getpurpledot.com/~gitbook/mcp).

# Integrate with a headless storefront

Install @purple-dot/browser on a headless Shopify storefront and open the checkout method your store uses.

For combined cart and express checkout, see [Choosing a checkout method](https://docs.getpurpledot.com/understanding-purple-dot/choosing-a-checkout-method.md#the-purple-dot-checkout).

## Before you start

* The store uses the Purple Dot checkout. Purple Dot sets the method. To change it, contact us.
* You have the public API key from **Settings** > **Integrations** in the Merchant Portal.
* The storefront can install npm packages.

## Steps

1. Install the storefront package:

```bash
npm install @purple-dot/browser
```

2. Initialize it when the storefront loads. Pass a cart adapter only for [combined checkout](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/combined-checkout.md):

```js
import * as PurpleDot from '@purple-dot/browser';

PurpleDot.init({
  apiKey: 'YOUR_PUBLIC_API_KEY',
});
```

3. Follow the page for the store's checkout method:
   * [Set up combined checkout for a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/combined-checkout.md)
   * [Set up express checkout for a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/express-checkout.md)

Hydrogen and React Native have their own guides: [Integrate with Hydrogen](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-hydrogen.md) and [Integrate with React Native](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-react-native.md).

## Verify

A variant whose pre-order state is `ON_PREORDER` shows a pre-order call to action and the waitlist's `display_dispatch_date`. Checkout opens in the Purple Dot checkout for that method.

## Troubleshooting

* [The pre-order button is not showing](https://docs.getpurpledot.com/troubleshooting/storefront-and-checkout/pre-order-button-is-not-showing.md)

## Related

* **Concept:** [How Purple Dot works with Shopify](https://docs.getpurpledot.com/e-commerce-platforms/shopify/how-purple-dot-works-with-shopify.md)
* **Do this:** [Set up combined checkout for a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/combined-checkout.md), [Set up express checkout for a headless storefront](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront/express-checkout.md)
* **Look up:** [Public API](https://docs.getpurpledot.com/purple-dot-apis/public-api.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-a-headless-storefront.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
