Packages narrative
packages / cart / next
cart / next
Functions
| Name | Description |
|---|---|
createCartEnsurer | Builds an "ensure a cart exists" helper for server actions and RSC entry points that need a non-null cart to operate on. Delegates to the supplied reader for the existing-cart path so cache dedup is preserved, then falls back to |
createCartReader | Builds an RSC-safe reader that resolves the active cart for the current request. The reader is wrapped in |
createFormCartActions | Wraps a |
createTypedCartActions | Builds the typed, JSON-arg server-action surface for cart-next hosts. Each returned method threads the supplied |
httpOnlyCookieStorage | Builds a |
nextEventBridge | Builds a Next.js-aware event bridge that pipes cart kernel events into |
Interfaces
| Name | Description |
|---|---|
AuthBridge | Pluggable identity bridge for |
CartIdStorage | Pluggable persistence contract for the active cart's identifier. cart-next ships |
CreateTypedCartActionsOpts | Construction options for |
FormCartActions | Set of |
HttpOnlyCookieStorageOpts | Options bag for |
NextEventBridge | Return type of |
TypedCartActions | Strongly-typed server-action surface built by |
Types
| Name | Description |
|---|---|
NextEventBridgeHandlers | Per-event handler map passed to |
createMockCartAdapter
Builds an inmemory cart adapter for host tests and contract selftests. State lives in a Map scoped to the returned instance, so each call is isolated. Capabilit
AuthBridge
Pluggable identity bridge for updatebuyeridentity mutations in . Wire this to your auth session source so the cart layer can attach the active buyer without dep