NextEventBridgeHandlers
Per-event handler map passed to . Each key is a
discriminant; TypeScript infers the narrowed event payload
for that variant so handlers receive the concrete fields — cart, line,
mutation — without casting. Omit keys for events you don't need to handle.
Definition
type NextEventBridgeHandlers = Partial<{ [K in …]: … }>;Partial<\{ [K in …]: … \}>
Example
const handlers: NextEventBridgeHandlers = {
'cart.line.added': async (event) => {
await analytics.track('AddToCart', { lineId: event.line.id });
},
};Related
AuthBridge CartIdStorage CreateTypedCartActionsOpts FormCartActions HttpOnlyCookieStorageOpts NextEventBridge TypedCartActions createCartEnsurer
httpOnlyCookieStorage
Builds a backed by a single HttpOnly cookie on the Next.js request/response. Serveronly by construction — cookies() is the App Router primitive and is unavailab
nextEventBridge
Builds a Next.jsaware event bridge that pipes cart kernel events into after() callbacks. Use this when a host needs to emit analytics, kick off downstream webho