Skip to main content
These hooks give your components access to live checkout data and the ability to modify the checkout experience. All hooks are TypeScript-ready with full type definitions, and are imported from @ollie-shop/sdk.

Quick Reference

useCheckoutSession

Read the parsed checkout session (cart items, customer, totals, locale) and validate it

useCheckoutAction

Mutate the checkout: add/remove items, update quantities, coupons, addresses, payments

useStoreInfo

Store metadata, theme tokens, props/settings, and injected components

useMessages

Add, remove, and clear notification messages

usePendingActions

Track in-flight checkout actions to drive loading states

useCheckoutOrder

Access the finalized order after checkout completes
Custom components must import only from @ollie-shop/sdk. It is externalized at build time; importing from internal packages (e.g. @ollie-shop/react) bundles them into your component and is not supported.

useCheckoutSession

The primary hook for reading checkout data. To change the cart, use useCheckoutAction β€” the session hook is read-only and does not expose mutation functions. It returns { session, rawSession, updateSession, sessionValidity, ... }. The parsed, platform-agnostic data lives on session.
Access cart contents and totals
session.totals (all amounts in minor units / cents):session.cartItems[]:

useStoreInfo

Access store metadata, theme tokens, and configuration.
Returned properties (Omit<StoreInfo, "messages">):

Combining Hooks

Use usePendingActions to disable buttons or show skeletons while a useCheckoutAction call is in flight β€” the pending list is updated automatically by the action hook.