FormCartActions

cart · /next·interface

Set of FormData-driven server actions returned by . Each method parses and validates a FormData payload before delegating to the typed action surface, enabling native <form action={…}> wiring that works without JavaScript while sharing the same server-side validation path as progressively enhanced calls.

Properties

addLineAction
unknown
applyDiscountCodeAction
unknown
applyGiftCardAction
unknown
dispatchAction
unknown
removeDiscountCodeAction
unknown

Example

const formActions = createFormCartActions({ typed });
// In a Server Component:
<form action={formActions.addLineAction}>
  <input name="variantId" value="gid://shopify/ProductVariant/123" />
  <button type="submit">Add to cart</button>
</form>

AuthBridge CartIdStorage CreateTypedCartActionsOpts HttpOnlyCookieStorageOpts NextEventBridge TypedCartActions NextEventBridgeHandlers createCartEnsurer

On this page