External sign-in
Hand an HTTPS authorization URL to the device and receive the OAuth callback in your page.
Start a sign-in
Pass bdk.auth.signIn an HTTPS authorization URL you already built — client id, scope, state, PKCE challenge, and normally redirect_uri. The SDK never builds that URL. With handoff: "page", the resolved result is the validated callbackUrl plus decoded query params.
This feature can be switched off in a given app build — check await bdk.capabilities.has("auth.oauth") before showing the UI. See Detect features. When it's off, the call resolves ok: false with code: "common/feature_disabled".
Hand off to the webview
Use handoff: "webview" to load the callback in the app webview. The resolved loaded: true only means that page opened — subscribe to auth.completed and auth.cancelled before you call, and treat those events as the outcome.
Handle the callback
Set redirectUri (or redirect_uri on the URL you build) to a callback within your app's registered scheme. Fragment-only OAuth responses are not supported.
A custom-scheme callback is not authoritative for identity — finish the session server-side.
Listen for the result
auth.completed reports { mode, provider, handoff } when the session finishes. auth.cancelled reports { mode, provider, reason } — mode is auto or explicit; reason is dismissed, provider_denied, or timeout. Subscribe before you call.