Developer guide
Web SDK (React)
Embed Rheo flows in the browser with @getrheo/react — resolve, render, Stripe Payment Links, and first-party attribution.
Purpose
Run the same Rheo flow construct in a host web app (quizzes, funnels, onboarding). There is no separate “web flow” type — authors use one canvas; pin warnings call out mobile-only or web-only steps.
Install
After @getrheo/react is published, install it in the host app:
pnpm add @getrheo/reactThis repository's example app depends on the workspace package until that release. Peer dependencies: react and react-dom ≥ 18.
How to
- Wrap your app with
RheoProviderand mountFlowwith a channel public id. - In App settings → Convert settings → Integrations, open the Web SDK card and add the site origin (scheme, host, and port). The Next.js example at
apps/example-web(pnpm dev:local:app:web) needshttp://localhost:5173added by you. Dashboard CORS is separate. A browser request from an origin this app did not list is rejected. - For payments, add a Stripe Integration Node with a Payment Link on
buy.stripe.comor anotherhttps://*.stripe.comhost (see Stripe Payment Links). Paste the app's webhook URL and signing secret into Stripe. No Stripe adapter onRheoProvider. A return restores the session.iap_purchaseis written only after Stripe confirms the Checkout Session. - Optionally customize
attribution(first-touch UTM capture is on by default and is not recaptured from the return URL).
import { RheoProvider, Flow } from '@getrheo/react';
export const App = () => (
<RheoProvider
config={{
publishableKey: import.meta.env.VITE_RHEO_PUBLISHABLE_KEY,
apiBaseUrl: import.meta.env.VITE_RHEO_API_BASE_URL,
}}
>
<Flow channelId="ch_…" />
</RheoProvider>
);Soft-degrades on web
| Feature | Web behavior |
|---|---|
| RevenueCat / Superwall / headless | Surface fails → Fallback edge |
request_os_permission | Treated as denied |
request_app_review | No-op (not_shown) |
| AppsFlyer | Not supported — use first-party UTMs / host providers |
Attribution
With attribution.enabled not set to false, the SDK writes canonical keys (acquisition.*, link.ext.*, attribution.isOrganic) from the page query string and document.referrer. Pass attribution.providers for host collectors.