Get the currently authenticated customer's profile
Check if a customer is currently authenticated
Connect a provider to the signed-in customer's account. The way in for a Microsoft account whose email Microsoft does not confirm: sign in with email first, then connect here.
Logout the current customer
Which sign-in options the store has turned on, including the providers' public client ids.
Refresh the access token using a refresh token
Register a new customer account (include company for B2B registration)
Send a magic link to the email
Manually set the customer access token. Useful when restoring from a persisted session.
Set or change the customer's password
Sign in with Klarna, Google or Microsoft: send the provider's id_token. Signs in a linked
customer, links an existing customer with the same email when the provider confirms it, or
creates an account (registration open, or the customer's organization matches a company's
sign-in domain). Check outcome for "pending-approval" (no tokens) before treating the
customer as signed in.
Disconnect a provider from the signed-in customer's account.
Update the current customer's profile
Verify a magic link token.
Call this from a user gesture (a "Sign in" button on the landing page), never on page load: corporate email link scanners render the page and would consume the one-time token before the customer clicks.
Verify the six-digit code that was emailed alongside the magic link.
email is the address the link was requested for; the code is bound to
it server-side and dies after a few wrong attempts. Immune to link
scanners and works across devices (request on desktop, read on phone).
Accept a company membership invite