Skip to main content

Getting Started

Requirements

  • React Native 0.76+ (iOS 15.4+, Android API 26+)
  • Expo SDK 52+ (if using Expo managed workflow)
  • @react-native-async-storage/async-storage
  • react-native-device-info
  • react-native-onesignal (optional — required for push notifications)

Installation

If you use Expo, install the required dependencies after adding the SDK:

Quick Start

Wrap your app’s root component in StackfrontProvider. This initializes the SDK, fetches the remote configuration, and makes all services available through context hooks.
App.tsx

StackfrontProvider Props

What Happens on Init

When StackfrontProvider mounts, the SDK automatically:
  1. Fetches remote config — retrieves your storefront access token, OneSignal app ID, and feature flags from the Stackfront API.
  2. Initializes the Storefront GraphQL client — connects to Shopify’s Storefront API using the fetched token.
  3. Initializes local storage — sets up AsyncStorage for wishlist and event caching.
  4. Registers for push notifications — if OneSignal is configured, initializes the SDK and requests notification permission.
  5. Tracks the app_opened event — sends a lifecycle event to the analytics pipeline.
  6. Sets ready to true — only then does your UI render.
Access the initialized state via the useStackfront() hook:

Next Steps