Authenticate Your UsersOnboarding Modal

Authenticate User via Onboarding Modal

Learn how to trigger and handle authentication using the Okto Onboarding Modal.

Methods Overview

MethodDescription
asyncopenOnboardingOpens the Okto Onboarding flow with your chosen primaryAuth (e.g., Email, Phone, or Google) and brand data

Show Onboarding Modal

openOnboarding(...) presents a guided onboarding flow to the user. This includes brand data, theming, and whichever primaryAuth type you’ve set in the openOnboarding() parameters. Under the hood, it launches a WebView that takes the user through various authentication options (Email OTP, Phone OTP, Google OAuth, etc.).

Parameters

ParameterTypeDescription
contextBuildContextThe Flutter build context. (Required)
gAuthCallbackFuture<String> Function()A function that returns a Google ID token (if using AuthType.GAUTH).
onLoginSuccessFunctionCallback triggered once the user completes onboarding successfully.
primaryAuthAuthTypeSet your default authentication flow. E.g. AuthType.EMAIL, AuthType.PHONE, AuthType.GAUTH.
titleStringA title for brand customization (optional).
iconUrlStringA brand icon URL (optional).
subtitleStringA subtitle for brand customization (optional).
Theming parametersString (color in hex)Additional theming (text colors, background, accent, etc.).

Response

Success Response

Field NameTypeDescription
resultFuture<void>Returns no meaningful response on success.

On this page