Customer & Orders
The SDK provides authentication, profile management, and order history through the Shopify Storefront GraphQL API. Tokens are managed in-memory by theCustomerService and synced via useStackfront().setCustomerAccessToken.
Quick Reference
Authentication Flow
- Register —
register({ email, password })creates a customer viaCUSTOMER_CREATEand opens a session with the same credentials in one action.createAccount(...)remains available for create-only. - Login —
login(email, password)creates an access token viaCUSTOMER_ACCESS_TOKEN_CREATEand syncs it to the SDK context (it also links the push device to the customer). Cart buyer identity is not set automatically — set it manually viaupdateBuyerIdentityafter login (see Cart Integration below) - Authed state —
hasSession/isAuthenticated(andcustomer.getAccessToken()) tell the UI a session exists; a revoked token clears itself and flips them back tofalse - Logout —
logout()deletes the token on Shopify and clears it from memory and storage
Cart Integration
When a customer logs in, the SDK automatically:- Sets the customer access token in the
CustomerService - Calls
setCustomerAccessTokenat the provider level - Links the customer ID to the push notification device
- Tracks
loginandlogoutevents
updateBuyerIdentity after login (available via useCart):

