Skip to main content

Signature

Presents the hosted flow full screen in a native WebView. Inside it, the browser SDK opens the same session the way vycheck({ session, mode: "iframe" }) does on the web, so the flow and its result match what you get there. The screen adds a native close button, which stays visible until the run settles. Once the flow is up, that button, Back on Android and handle.close() close it the same way the flow’s own close control does. If the run already has a verdict, closing delivers that result through onComplete, so the person never loses a finished check. Otherwise it calls onClose. If the flow does not answer within a short grace period, the screen closes anyway and calls onClose. Before the flow is up, they close the screen at once and call onClose. On iOS, pass a from view controller that is on screen and is not being dismissed. If it is not, onError fires at once with could not open the verification screen, and the next vycheck() works normally. Each callback fires only after the screen has gone, so you can call vycheck() again from inside onError or onClose. If your app dismisses the screen itself, the run ends with onClose. On React Native, close() affects only its own run. After that run has settled, close() does nothing, and it never closes a newer run.

Options

string
required
The session_id from /v3/initialize. The SDK opens that run: no key, no init(), ever passed here.
"light" | "dark" | "auto"
default:"auto"
"light" or "dark" forces that appearance, and the flow follows it. "auto" follows the device at the moment vycheck() is called.
(result: VyResult) => void
required
Required on Android and iOS. Optional on React Native, where the returned promise also resolves with the same result. Fires once, with a settled result. token is always present.
() => void
The person dismissed the screen without finishing. This is not an error, and it is not a settled run. Do not call vyget() to look up its outcome: vyget() returns the last completed result, which can belong to an earlier run, not this dismissed one.
(message: string) => void
The run never reached a settled outcome at all. See Errors.
init() only sets appBase, once, for every call. It does not set theme, onComplete, onClose, or onError. Pass those to vycheck() itself, every time.

Returns

Errors

Never throws synchronously. See Errors for what reaches onError and, on React Native, what the promise rejects with.

Example