Skip to main content

Biometric sign-in for Expo, iOS, and Android

Category
SDK
Published

Let returning mobile users sign in with a trusted device and the platform biometric prompt.

Clerk's mobile SDKs can now enroll a signed-in user's current device as a trusted device, then let returning users sign in with Face ID, Touch ID, or Android biometrics. Clerk verifies a device-bound challenge while the private key stays on the device.

Prebuilt auth and user profile views can show the enrollment prompt, biometric sign-in button, and current-device toggle. Custom flows can use the trusted-device APIs directly.

Expo

import { useTrustedDevices } from '@clerk/expo'

const { enroll } = useTrustedDevices()

await enroll()
import { useTrustedDevices } from '@clerk/expo'

const { signIn } = useTrustedDevices()

await signIn()
import { useTrustedDevices } from '@clerk/expo'

const { revoke } = useTrustedDevices()

await revoke(trustedDeviceId)
try await Clerk.shared.trustedDevices.enroll()
try await Clerk.shared.auth.signInWithTrustedDevice()
try await Clerk.shared.trustedDevices.revoke(id: trustedDeviceId)
scope.launch {
  Clerk.trustedDevices.enroll()
}
scope.launch {
  Clerk.auth.signInWithTrustedDevice()
}
scope.launch {
  Clerk.trustedDevices.revoke(trustedDeviceId)
}

See the biometric sign-in docs for setup and reference material:

Contributors
Sean Perez
Sam Wolfand

Share this article