Returns
Promise<ShopifyCustomer | null> - Customer object if logged in, null otherwise.
Examples
Basic initialization
Handling an expired session
.init() never throws — if the stored token is invalid or expired, the token is cleared and null is returned.
Combined with subscribe
Always call
.init() early in your page lifecycle. This restores the customer session and triggers any subscribers with the current state.