0.2.0 ports the missing Shopify commerce surfaces from
@jaimin28/react-native-shopify into the SDK while keeping Stackfront’s
managed features and react-query architecture. Existing screens keep working:
the legacy members below are deprecated, not removed.
Package renamed
The package is now@stackfront/react-native-shopify (it was
react-native-stackfront-sdk). Replace the import specifier and the install
line; the /keychain subpath moved with it:
StackfrontSdk) and the podspec are unchanged, so no
iOS/Android reconfiguration is needed beyond reinstalling dependencies.
Auth hardening in 0.2
register(input)creates the account and signs in with the same credentials in one action.createAccount(input)remains for create-only.createAccount/createnow throwCustomerCreateErroron ShopifycustomerUserErrorsinstead of returning a silently failed payload.- Dead sessions self-heal: a
customer: nullresponse clears the token, persistence and auth-scoped caches, andhasSessionflips tofalse.CustomerSessionErroris thrown withreason: 'invalid' | 'expired'. - Renewal is single-flight, happens during boot when the token is inside the 30-day window, and never overwrites a session that changed mid-request.
- Double-submit is serialized: rapid duplicate login/register taps cannot create two tokens or two accounts.
- New flags on
useCustomer():isAuthenticated(alias ofhasSession),isRestoring,isRefreshing. - A follow-up profile read failing after a successful login/registration is treated as transient — the session stands and the profile query retries.
Not adopted from the reference package
- Multi-account sessions / lock-unlock: the SDK keeps one active session. Multiple long-lived Shopify tokens on a device multiply exposure, and a lock that only flips a boolean is cosmetic. Use sign-out/sign-in for account switching and the platform biometrics for app lock.
- Optimistic
updateCustomer: the SDK keeps server truth; the profile cache is seeded with Shopify’s response (no rollback flicker). - Keychain by default: keychain remains an explicit opt-in behind the
/keychainsubpath so apps that never use it do not bundle the peer.
At a glance
useProduct
The string form still works and data is still the raw Storefront node:
datais kept as an alias ofproduct(deprecated for new screens).metafieldsis a flat array; request them in the same round trip via themetafieldsoption.- A selected variant is resolved even before the shopper touches an option
when the variant matrix has a single valid combination; impossible
combinations appear in
disabledOptions. addToCartuses the SDK’s cart and is double-submit guarded.
useSearch
setQuery(text)updatesqueryimmediately and performs a debounced Storefront read; do not debounce again in the screen.- History is persisted by the SDK (
search_history, max 20). If your app kept its own recent-search list, migrate it (or switch to the SDK’s) to avoid two competing histories. suggestionscombines history with titles/vendors/tags from the current result page, or pass explicit sources viaavailableSuggestionsOptions.datais still the rawsearchconnection;resultsis the flattened node array.
useWishlist
- Items gained
id,variantId,selectedOptions,title,image,createdAtandupdatedAt.addedAtremains as a deprecated mirror ofcreatedAt, so existing cards keep rendering. isInWishlist(productId, variantId?)is variant-aware; without a variant it matches any saved variant of the product.remove(productId, variantId?)removes one variant, or every variant of the product whenvariantIdis omitted.- The first boot after upgrading reads the legacy
wishlistkey, writeswishlist_v2, and removes the legacy key. No action is required. - Saving richer items is a drop-in upgrade:
useOrders
useOrders() without arguments keeps the flat-list contract. Passing any
option switches to the paged form:
useInfiniteOrders, useOrder, useOrderHistory,
useOrderTracking, usePrefetchOrders, usePendingOrders,
useCompletedOrders, useCancelledOrders, plus the pure orders/* helpers
(deriveOrderStatus, extractTrackingInfo, deriveOrderTimeline,
toStorefrontOrderSort, filterOrders).
The Storefront API has no standalone order-by-id query and no full order
timeline. useOrder is cache-first (falling back to the first page of 50),
and tracking/timeline are derived honestly from successfulFulfillments,
financialStatus, fulfillmentStatus and canceledAt. Shopify’s official
timeline link is exposed as statusUrl.
Addresses and menus
- Address ids carry a rotating
customer_access_tokensuffix. Pass them back as received and compare withsameAddressId(a, b)— never===. - Menu
routevalues are app-agnostic paths (/products/<handle>), not a hard-coded deep-link scheme. - Address mutations invalidate both the address book and the customer profile; menu reads are public Storefront data.
useCheckout
getCheckoutUrl() still works but is deprecated:
- The session is a view over the cart. Storefront no longer exposes a
checkout*API,expiresAt,completedAtor a cancel mutation. refresh()on app foreground discovers a consumed/expired cart (it stops resolving). Completion/cancellation deep links are reported by your app viamarkCompleted()/markCancelled().cancel()abandons the session locally and leaves the cart intact.- The SDK does not open browsers or listen to
Linking/AppState.
Keychain (optional)
react-native-keychain is an optional peer dependency. Keep AsyncStorage
(the default) or opt in:
Deprecations
Nothing above is removed in 0.2.0.

