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
useCheckoutSession
The primary hook for reading checkout data. To change the cart, useuseCheckoutAction β 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.
- π Cart Data
- π€ Customer Data
- π οΈ Modifying the Cart
Access cart contents and totals
session.totals (all amounts in minor units / cents):session.cartItems[]:useStoreInfo
Access store metadata, theme tokens, and configuration.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.