Cart Overview
The SDK manages the shopping cart lifecycle through the Shopify Storefront GraphQL API. The cart ID is persisted in AsyncStorage so it survives app restarts.How It Works
- First add — calling
addLineswhen no cart exists automatically creates one - Subsequent operations — the stored cart ID is used for all mutations
- State sync — each mutation returns the updated cart and updates local state
- Clear — removes the cart ID from storage; next add creates a fresh cart