See Types for full interface definitions.
Features
- No Backend Needed - Shopify handles all user data and authentication
- Session Persistence - Customer stays logged in across browser sessions
- Reactive Updates - Subscribe to auth state changes for automatic UI updates
- Full Account Access - Orders, addresses, profile management
Methods
.init()
Initialize customer session
.login()
Log in with email and password
.register()
Create new customer account
.logout()
Log out current customer
.get()
Get current customer profile
.update()
Update customer profile
.orders()
Get order history
.addresses()
Manage shipping addresses
.recover()
Send password reset email
.reset()
Reset password with token
.subscribe()
Listen for auth changes
Quick Example
How It Works
- Customer logs in → Shopify validates credentials and returns an access token
- Token stored locally → Saved in
localStoragewith expiration - Token auto-restores → Call
.init()on page load to restore session - Token used for API calls → All customer operations use the stored token