Skip to main content
React integrations usually start with FanfareProvider and ExperienceWidget.

Install

The React package has peer dependencies on react, react-dom, and motion.

Add the provider

FanfareProvider initializes the core SDK, restores the local session by default, and provides the SDK to hooks and components below it.

Render the full widget

Use checkoutUrl for default granted-state navigation. Use onGranted when your application needs to coordinate custom routing or server handoff.
Avoid logging the grant value to third-party tools or placing it in URLs.

Build custom React UI

Use useExperienceJourney when you want React state and lifecycle handling without the default widget layout.
The hook returns the same public journey model as the core SDK: useExperienceJourney is the React-friendly wrapper around the underlying journey stores. It subscribes to the current view$ and snapshot$ values for you, updates React state when they change, and cleans up those subscriptions when the component unmounts. Most React UI should render from the returned view instead of subscribing to journey.view$ directly.