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-storagereact-native-device-inforeact-native-onesignal(optional — required for push notifications)
Installation
Quick Start
Wrap your app’s root component inStackfrontProvider. This initializes the SDK, fetches the remote configuration, and makes all services available through context hooks.
App.tsx
StackfrontProvider Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
shopDomain | string | Yes | — | Your Shopify store domain (e.g. my-store.myshopify.com). |
developerApiKey | string | Yes | — | Your Stackfront developer API key. Get one from the dashboard. |
apiBaseUrl | string | No | SDK’s default API | Base URL for the Stackfront REST API. |
appVersion | string | No | — | Current version of your app. Included in events and device metadata. |
children | ReactNode | Yes | — | Your app’s component tree. |
What Happens on Init
WhenStackfrontProvider mounts, the SDK automatically:
- Fetches remote config — retrieves your storefront access token, OneSignal app ID, and feature flags from the Stackfront API.
- Initializes the Storefront GraphQL client — connects to Shopify’s Storefront API using the fetched token.
- Initializes local storage — sets up AsyncStorage for wishlist and event caching.
- Registers for push notifications — if OneSignal is configured, initializes the SDK and requests notification permission.
- Tracks the
app_openedevent — sends a lifecycle event to the analytics pipeline. - Sets
readytotrue— only then does your UI render.
useStackfront() hook:
Next Steps
- Learn about Core Concepts — the architecture, services, and hooks.
- Explore the Products & Search API to display your catalog.
- Set up Push Notifications with OneSignal.