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

useLogin

Open and close the native login modal

useNavigation

Block or allow leaving the current checkout step
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 never calls the platform. updateSession only replaces the context with a session you already have, and revalidate re-fetches the current one. It returns { session, rawSession, updateSession, sessionValidity, sessionValidate, revalidate, revalidateAsync, isFallback, fallbackError, clearFallback }. The parsed, platform-agnostic data lives on session. See useCheckoutSession for every return value.
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.