Biometric unlock,
the native way.
Face ID, Touch ID, fingerprint and device passcode for NitroUI apps. The expo-local-authentication API, calling LocalAuthentication on iOS and BiometricPrompt on Android directly.
bun add nitro-local-authBoth platforms, one module
A Swift and a Kotlin implementation behind one TypeScript spec.
Face ID, Touch ID, Optic ID
One LAContext prompt with passcode fallback, custom cancel and fallback labels.
Fingerprint, face and iris
The framework prompt with Class 2 or Class 3 biometrics, no AndroidX biometric.
An API you know
The same methods without the Async suffix, with string unions instead of enums.
Linked by the CLI
nitro-ui prepare generates the bindings and links the Swift and Kotlin sources.
Built for real prompts
The edge cases of the system prompt, handled in native code.
Synchronous status
hasHardware, isEnrolled and getEnrolledLevel return at once, no await needed.
Never rejects
authenticate resolves with success or one of 15 typed error codes.
Passcode fallback
Passcode, PIN, pattern or password by default; biometrics only on request.
Biometric class
Accept Class 2 or only Class 3 biometrics on Android 11 and later.
Cancel from code
cancelAuthenticate closes the prompt; a new call replaces the open one.
Lockout state
isLockedOut reports biometrics locked after too many failed attempts.
Setup guards
A missing Face ID key or permission gives not_available, not a crash.
Android 8 and later
BiometricPrompt from Android 10, the keyguard screen on 8 and 9.
One call to unlock
Check the status synchronously, await the prompt, switch on a typed error.
Read the guidesimport { LocalAuthentication } from 'nitro-local-auth'
if (LocalAuthentication.hasHardware() && LocalAuthentication.isEnrolled()) {
const result = await LocalAuthentication.authenticate({
promptMessage: 'Unlock your account',
cancelLabel: 'Not now',
})
if (result.success) {
// Unlocked.
}
}
Add biometric unlock today
Install the package, add one Info.plist key and one permission, and open the prompt.