WebView. See the overview for detection, hosting, and the shared CORS requirements.
There are two building blocks. The three ready-made routes are built on exactly these:
buildUpgradeUrl({ redirectUrl }, client?)— returns the upgrade app URL. It readsenvironmentIdfrom your client and validates the return URL for you, so all you own is where you point it.- React to completion — this is the branch point, and it depends on how you mounted the app.
1. Build the URL
2. React to completion
- Web (iframe / window)
- React Native (WebView)
When you host the app in an iframe or a window you opened, it signals completion with an origin-checked
postMessage. subscribeToUpgradeCompletion is the DOM-agnostic primitive that listens for it, refreshes the session on success, and hands you the outcome. Always call the returned unsubscribe function when your surface unmounts.See also
- Upgrade overview — detection, hosting, and shared requirements
- Redirect to the app
- Embed the app (iframe)
- Popup (new window)