Skip to main content
The redirect, embed, and popup routes cover almost every case. Reach for this route only when you need to own the mounting and lifecycle yourself — a custom window manager, a bespoke iframe host, or a React Native 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:
  1. buildUpgradeUrl({ redirectUrl }, client?) — returns the upgrade app URL. It reads environmentId from your client and validates the return URL for you, so all you own is where you point it.
  2. 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

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

Last modified on July 24, 2026