Skip to main content

API Reference

Complete reference for every function exported by @sbaiahmed1/react-native-biometrics, grouped by area.

Configuration

FunctionDescription
configureKeyAlias()Configure a custom key alias for biometric key storage
getDefaultKeyAlias()Get the current default key alias
configure()Configure the library with a configuration object

Core Functions

FunctionDescription
isSensorAvailable()Check if biometric authentication is available
simplePrompt()Basic biometric authentication with a custom message
authenticateWithOptions()Enhanced authentication with customizable options

Key Management

FunctionDescription
createKeys()Generate cryptographic keys for biometric operations
createKeysWithOptions()Options-object variant, including prompt-free keys
keyExists()Check whether a key exists without prompting
getPublicKey()Retrieve the public key without prompting
sign()Sign data without any authentication prompt
deleteKeys()Delete previously created keys
getAllKeys()Retrieve all stored keys

Device Security

FunctionDescription
getDeviceIntegrityStatus()Detect rooted/jailbroken devices and runtime hooks

Debugging & Diagnostics

FunctionDescription
getDiagnosticInfo()Comprehensive diagnostic information
runBiometricTest()Test biometric functionality end to end
setDebugMode()Enable/disable debug logging

Logging & Monitoring

FunctionDescription
enableLogging()Enable/disable the centralized logging system
setLogLevel()Set the minimum log level
configureLogger()Configure the logger with advanced options
getLogs()Retrieve stored log entries
clearLogs()Clear stored log entries

Key Integrity Validation

FunctionDescription
validateKeyIntegrity()Comprehensive key integrity validation
verifyKeySignature()Generate a signature with the specified key
signWithOptions()Sign with advanced security controls
validateSignature()Validate a signature against the original data
sha256()Native SHA-256 hashing
getKeyAttributes()Detailed attributes of a key

Biometric Change Detection

FunctionDescription
subscribeToBiometricChanges()Subscribe to biometric change events
unsubscribeFromBiometricChanges()Unsubscribe from change events
startBiometricChangeDetection()Start monitoring for biometric changes
stopBiometricChangeDetection()Stop monitoring for biometric changes
BiometricChangeEventThe change event type

Error Codes

See Error Codes for the common error codes returned by authentication methods.