AuthView

fun AuthView(modifier: Modifier = Modifier, clerkTheme: ClerkTheme? = null, logo: @Composable () -> Unit? = null, initialIdentifier: String? = null, initialFirstName: String? = null, initialLastName: String? = null, lockPrefilledFields: Boolean = false, persistIdentifiers: Boolean = true, preferGoogleOneTap: Boolean = true, startSocialOAuthAsSignUp: Boolean = false, enableRestoreCredentials: Boolean = false, unsafeMetadata: Map<String, Any>? = null, isDismissible: Boolean = true, onDismiss: () -> Unit? = null, onAuthComplete: () -> Unit = {}, mode: AuthMode = AuthMode.SignInOrUp)

Prebuilt Clerk authentication flow.

When using this as a non-dismissible root authentication view, observe Clerk.isAuthFlowCompleteFlow to choose between this view and authenticated content. A session can become active while post-auth steps — session tasks or the biometric credential enrollment prompt — still need to be shown.

When your own navigation takes this view off screen and saves its state, as Navigation Compose, Navigation 3 and Fragment back stacks do, the view comes back on the screen it was showing. Its in-progress input comes back too when the destination has its own ViewModelStoreOwner: a Navigation Compose destination, a Navigation 3 entry with rememberViewModelStoreNavEntryDecorator(), or a Fragment. When the view's ViewModelStoreOwner is the Activity, its ViewModels are cleared when it leaves composition, so it comes back with new ViewModels and the input is lost.

Parameters

initialIdentifier

Optional initial value for the identifier field. Phone-like values are routed to the phone number field automatically.

initialFirstName

Optional initial value for the first name field during sign-up.

initialLastName

Optional initial value for the last name field during sign-up.

lockPrefilledFields

When true, prefilled identifier and sign-up name fields are read-only.

persistIdentifiers

When false, stored auth-start identifiers are cleared and future edits are kept in memory only for the lifetime of the current view.

preferGoogleOneTap

When true, Google social auth uses native Google One Tap if configured. When false, Google social auth always uses browser OAuth.

startSocialOAuthAsSignUp

When true, browser OAuth social auth starts from a sign-up attempt and transfers back to sign-in if the selected account already exists.

enableRestoreCredentials

When true, the view uses Google Play Restore Credentials to keep users signed in when they move the app to a new Android device. On the first launch after the app is installed or restored onto a device, the start screen silently tries the restore credential that device setup transferred and completes authentication with it; when there is none, the start screen works as usual. Later launches never try it again, so a user whose session ended (sign-out, revocation, or expiry) is not signed back in silently. After the user signs in or signs up, the view creates a restore credential for them in the background unless this device already holds theirs. A device holds one restore credential, which belongs to the user who most recently signed in, and creating it replaces the passkey this device created for the same user before. Restore credentials are passkeys named "Android restore key", so this needs passkeys enabled as a first factor for the instance. Signing out through Clerk deletes the device's restore credential.

unsafeMetadata

Custom metadata to attach to users created by the prebuilt sign-up flow. This metadata is not validated by Clerk and should not contain sensitive information.

isDismissible

When true, the auth start screen shows a close affordance.

onDismiss

Called when the user presses the close affordance. When omitted, the close affordance falls back to the system back dispatcher.

onAuthComplete

Called when authentication completes.

mode

Determines whether the flow starts as sign-in, sign-up, or sign-in-or-up.

logo

Replaces the logo shown by authentication screens. When provided, it takes precedence over the dashboard-configured logo and the ClerkTheme.design logo sizing — the SDK applies no sizing or spacing, so you are responsible for its layout and accessibility. To only change the size of the dashboard-configured logo, set com.clerk.api.ui.ClerkDesign.logoMaxHeight instead.