> 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-react-native.md). Agents can also search and read this documentation through its [MCP server](https://docs.getpurpledot.com/~gitbook/mcp).

# Integrate with React Native

Use the Storefront API cart and @purple-dot/browser in a React Native app.

React Native apps use combined checkout and the Shopify Storefront API cart. See [Combined cart](https://docs.getpurpledot.com/understanding-purple-dot/choosing-a-checkout-method.md#combined-cart).

## Before you start

* The app already creates a Shopify cart with the Storefront API.
* You have the public API key from **Settings** > **Integrations** in the Merchant Portal.
* The shop domain and Storefront API public access token are available to the app.
* Purple Dot has a Storefront API public access token stored for the store. The hosted checkout reads it from the store. You don't enter it in the Merchant Portal: send it to Purple Dot, who store it for your store.

## Steps

1. Install `@purple-dot/browser`.
2. Initialize it with `ShopifyStorefrontCart`. The constructor takes the shop domain, then the Storefront API public access token. See [Set up combined checkout with React Native](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-react-native/combined-checkout.md) for line attributes, the cart check, and the checkout WebView.

```js
import * as PurpleDot from '@purple-dot/browser';
import { ShopifyStorefrontCart } from '@purple-dot/browser/shopify-storefront-cart';

PurpleDot.init({
  apiKey: 'YOUR_PUBLIC_API_KEY',
  cartAdapter: new ShopifyStorefrontCart(
    'your-store.myshopify.com',
    'STOREFRONT_PUBLIC_ACCESS_TOKEN'
  ),
});
```

## Verify

A pre-order line in the Shopify cart has a `__releaseId` attribute. Checkout opens a WebView on the hosted combined checkout, and closing it posts `pd:checkout_closed`.

## 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 with React Native](https://docs.getpurpledot.com/e-commerce-platforms/shopify/integrate-with-react-native/combined-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-react-native.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.
