TypedCartActions

cart · /next·interface

Strongly-typed server-action surface built by . Each method accepts a serializable plain-object args bag (no FormData) so client components can invoke actions through startTransition or the predictive queue without re-parsing form state on the server.

Properties

addLine
unknown
applyDiscountCode
unknown
applyGiftCard
unknown
dispatch
unknown
removeDiscountCode
unknown

Example

const actions = createTypedCartActions(opts);
const result = await actions.addLine({
    variantId: 'gid://shopify/ProductVariant/123',
    quantity: 1,
    idempotencyKey: crypto.randomUUID(),
});

AuthBridge CartIdStorage CreateTypedCartActionsOpts FormCartActions HttpOnlyCookieStorageOpts NextEventBridge NextEventBridgeHandlers createCartEnsurer

On this page