Note
This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. Contact your Incode Representative for upgrade information and check if you are a candidate for this upgrade.
Full rollout to all clients still TBD.
The Redirect to Mobile module bridges desktop-initiated verifications to mobile devices: it generates a QR code (and optional SMS link) that hands the user off to their phone, where camera-bearing modules (selfie, ID capture) continue. Used when desktop browsers can't deliver the verification experience the customer needs.
This module combines composite / orchestrator and backend-process traits. It fetches the redirect URL, polls onboarding status, and emits finished once the mobile device completes the flow.
Tag
<incode-redirect-to-mobile> is a standard Web Component. Importing the UI subpath registers the custom element; importing the CSS applies the module's styles.
import '@incodetech/web/redirect-to-mobile';
import '@incodetech/web/redirect-to-mobile/styles.css';
Properties
| Property | Type | Required | Description |
|---|---|---|---|
config |
RedirectToMobileConfig |
❌ | Configuration options |
onFinish |
() => void |
❌ | Called when the mobile flow completes |
onError |
(error: string) => void |
❌ | Called when an error occurs |
Configuration
type RedirectToMobileConfig = {
flowId?: string;
url?: string;
disableSmsOption?: boolean;
addContinueToDesktop?: boolean;
qrPhishingResistance?: boolean;
authHint?: string;
externalId?: string;
lang?: string;
};
| Option | Type | Required | Description |
|---|---|---|---|
flowId |
string |
❌ | Session flow ID; injected by the orchestrator. |
url |
string |
❌ | Pre-computed redirect URL. When omitted, the module fetches one from the backend. |
disableSmsOption |
boolean |
❌ | Hide the SMS-link option (QR only). |
addContinueToDesktop |
boolean |
❌ | Show a "Continue on desktop" affordance for users who'd rather not switch. |
qrPhishingResistance |
boolean |
❌ | Enable QR phishing protection for the mobile handoff. |
authHint |
string |
❌ | QR/auth hint for the mobile leg. |
externalId |
string |
❌ | Forwarded to the new mobile session. |
lang |
string |
❌ | Forwarded language code. |
When <incode-flow> renders this module, set redirectToMobileUrl on FlowConfig. The flow maps that value to this module's url option.
State machine
RedirectToMobileState is a discriminated union over status:
| Status | Description |
|---|---|
idle |
Initial state. |
loading |
Fetching the redirect URL (or warming the QR). |
redirecting |
QR / SMS option visible; polling onboarding status. User completes flow on mobile. |
finished |
Mobile flow completed (status moved to ONBOARDING_FINISHED). |
continue |
The user chose to stay on desktop instead of switching devices. Terminal, and deliberately separate from closed and error. |
closed |
User dismissed. |
error |
Fatal error. |
Behind the scenes the module polls onboarding status (ONBOARDING_NOT_STARTED → ONBOARDING_IN_PROGRESS → ONBOARDING_FINISHED) and surfaces only the user-relevant transitions.
continue exists so you can wire "keep going on desktop" to its own handler. Treat it as a deliberate user choice, not a dismissal or a failure. It appears only when addContinueToDesktop is enabled.
Redirecting-state properties
| Property | Type | Description |
|---|---|---|
redirectUrl |
string |
Link to encode in the QR code or display as the mobile handoff. |
phonePrefix |
string |
Initial phone prefix for the SMS input. |
smsSent |
boolean |
Show confirmation after a successful send. |
smsFailed |
boolean |
Show SMS failure feedback. |
smsResendTimer |
number |
Remaining resend cooldown in seconds. |
canResendSms |
boolean |
Whether to offer resend. |
error |
string | undefined |
Current SMS error, when present. |
Read these fields only in redirecting. Use canResendSms to enable resend, display smsResendTimer during cooldown, and keep the QR handoff visible if SMS fails.
API methods
Beyond the shared composite / orchestrator set:
| Method | Purpose | Callable when |
|---|---|---|
sendSms(phone) |
Text the handoff link to that number. | redirecting |
resetSms() |
Clear the SMS state so the user can re-enter their number. | redirecting, after a send |
continueOnDesktop() |
Skip the handoff and continue here. Advances to continue. |
redirecting, when addContinueToDesktop is enabled |
retry() |
Retry after a failed URL fetch or send. | error |
See also
- Session Management: how the desktop and mobile legs share a session token
- Module Patterns → composite
- Individual Modules