BiometricCredentials

The main entry point for biometric credential operations.

Access via Clerk.biometricCredentials.

Enrolling generates a biometric-gated private key in the Android Keystore and registers its public key with Clerk. Signing in signs a server challenge with that key after the user passes the system biometric prompt. The private key never leaves the device.

Example usage:

// Enroll the current device while signed in
Clerk.biometricCredentials.enroll()

// Later, sign in with biometrics
Clerk.biometricCredentials.signIn().onSuccess { signIn ->
// Session created
}

Properties

Link copied to clipboard

Whether biometric-gated keys can be created and used on this device.

Functions

Link copied to clipboard
suspend fun availability(id: String? = null, identifierHint: String? = null): BiometricCredentialAvailability

Returns local biometric sign-in availability.

Link copied to clipboard

Returns biometric sign-in availability for the current signed-in user, reconciling the local credential with the server.

Link copied to clipboard

Returns local biometric sign-in availability for the current signed-in user without reconciling with the server.

Link copied to clipboard
suspend fun enroll(name: String? = null, identifierHint: String? = null, policy: BiometricCredentialPolicy = BiometricCredentialPolicy.BIOMETRY_OR_DEVICE_PASSCODE, promptTitle: String? = null, promptSubtitle: String? = null): ClerkResult<BiometricCredential, ClerkErrorResponse>

Enrolls the current app installation as a biometric credential.

Link copied to clipboard
fun forgetLocalCredentials(deletedUserId: String): Int

Deletes local biometric credentials and keys belonging to deletedUserId.

Deletes account-scoped local credentials, retaining failed cleanup work for the next SDK initialization.

Link copied to clipboard

Lists active biometric credentials for the signed-in user.

Link copied to clipboard
fun localAvailability(id: String? = null, identifierHint: String? = null): BiometricCredentialAvailability

Returns local biometric sign-in availability without reconciling with the server.

Link copied to clipboard

Revokes a biometric credential for the signed-in user.

Link copied to clipboard

Revokes the available local biometric credential for the current signed-in user, if one exists.

Link copied to clipboard
suspend fun signIn(id: String? = null, identifierHint: String? = null, promptTitle: String? = null, promptSubtitle: String? = null): ClerkResult<SignIn, ClerkErrorResponse>

Signs in with a locally enrolled biometric credential.

Link copied to clipboard
suspend fun validateLocalCredentialIfPossible(id: String? = null, identifierHint: String? = null): BiometricCredentialValidationResult

Validates the local biometric credential against the server when possible.