End-to-End Guide: Session Syncing Between Headless Storefront and Stencil Checkout
End-to-End Guide: Session Syncing Between Headless Storefront and Stencil Checkout
End-to-End Guide: Session Syncing Between Headless Storefront and Stencil Checkout
This guide outlines the interim solution to sync a shoppers authentication (login/logout) session between a headless storefront and Stencil checkout.
Be aware that this solution removes the ability to sign in directly at checkout. Instead, authentication must occur through the headless storefront’s login flow.
Before session syncing can work, your headless storefront must be configured to support authentication redirects.
Security note: For Login/Logout routes, developers are responsible for
validating the redirectTo parameter to prevent open redirects. We recommend
restricting this to relative paths (e.g. /checkout) only.
/checkout route
Your headless storefront should include a /checkout route that redirects to BigCommerce Stencil Checkout.
Login route with redirectTo support
Your storefront’s login page must accept a redirectTo query parameter that determines where the shopper is redirected after login.
Logout route with redirectTo support
Your storefront must also expose a /logout route that logs the shopper out and then consumes a redirectTo query parameter.
While this setup can be configured on the default channel, we recommend using a secondary channel to avoid coupling with your primary storefront.
Use the Update Channel-Specific Checkout Settings API call:
Payload: