@shoppexio/storefront/customer when your storefront runs on your own domain and you want to build the customer panel yourself. Shoppex handles email OTP login, tenant isolation, orders, and download authorization. Your frontend owns the UI.
Headless customer accounts require an active Business plan. They reuse the same publishable key and allowed origins as Headless Checkout.
Setup
Open Dashboard -> Settings -> Developer -> Headless Checkout. Generate a publishable key and add the exact origin that hosts the customer page, for examplehttps://yourstore.com.
shx_ Developer API key in this client.
OTP login
sessionStorage and is valid for up to 12 hours. rememberMe: true stores it in localStorage and keeps the customer signed in for up to 30 days. Both are capped by the underlying Shoppex buyer session. A logout or an unauthorized response removes the saved session.
Use rememberMe only after the buyer explicitly selects a Keep me signed in option on a private device.
Customer and orders
me, order-list, and order-detail response contracts before returning them. Prices remain decimal strings so your UI does not introduce floating-point rounding.
Downloads
downloadIndex returned by order(). The SDK removes hosted-portal-only download URLs so a self-hosted site never follows a broken /api/customer/* link or receives an unsafe aggregate HTML launcher.
Logout and session state
logout() revokes only this external customer session. It does not sign the buyer out of a separate Shoppex-hosted customer portal tab. If the network request fails, the SDK keeps the local token so your UI can retry the revocation; a successful logout or an already-unauthorized response clears it.
Security boundary
Every customer request must pass all of these checks:- valid
pk_live_orpk_test_publishable key - exact browser
Originin the shop’s allowed-origin list - active Business plan
- valid
hcs_customer session bound to the same origin and shop - invoice ownership for order detail and downloads