Function: createBrowserCartCookieStore()
createBrowserCartCookieStore(
options?):CartCookieStore
Build a browser-side CartCookieStore backed by document.cookie.
SSR-safe: when document is unavailable (Node / Edge SSR) get returns null
and set/clear are no-ops — the runner falls back to creating a cart on
first client-side interaction.
Defaults: maxAge = CART_COOKIE_MAX_AGE (30 days), samesite=lax, path=/,
secure auto-detected from location.protocol. Pass per-call maxAge via
set(cartId, { maxAge }) if needed.
Parameters
options?
BrowserCartCookieStoreOptions
Returns
Example
const runner = createCartRecoveryRunner({
cartClient,
cookieStore: createBrowserCartCookieStore(),
});