CartKernel

cart · /core·interface

Host-facing surface returned by . Exposes typed read, create, and mutate operations that run through the middleware chain and broadcast lifecycle events without exposing the underlying adapter directly.

Properties

capabilities
type
string
create
unknown
mutate
unknown
on
unknown

Example

const kernel: CartKernel = createCart({ adapter });
const cart = await kernel.create(ctx);
await kernel.mutate(ctx, { kind: 'add-line', variantId: 'v_1', quantity: 1 });

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter

Sourcekernel.ts:20Edit the JSDoc directly

On this page