FanfareProvider and ExperienceWidget.
Install
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
checkoutUrl for default granted-state navigation.
Use onGranted when your application needs to coordinate custom routing or server handoff.
Build custom React UI
UseuseExperienceJourney when you want React state and lifecycle handling without the default widget layout.
| Field | Use for |
|---|---|
journey | Access to the underlying journey handle. |
view | Normal rendering and state-gated actions. |
snapshot | Debugging or exhaustive inspection. |
error | Adapter-level setup or action errors. |
start() | Convenience method for starting the journey. |
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.