@mahibhaque/expo-biometrics
v1.1.0
Published
A lightweight Expo library for biometric authentication across iOS and Android
Maintainers
Readme
✨ Features
- 🔒 Unified API - Single interface for iOS and Android biometric authentication
- 📱 Multiple Biometric Types - Face ID, Touch ID, Fingerprint, and more
- 🛠️ Advanced Options - Customizable prompts, fallback options, and device credentials
- 🔑 Key Management - Create and manage cryptographic keys (EC256/RSA2048) for secure operations
- 🛡️ Device Integrity - Detect compromised devices (rooted/jailbroken) for enhanced security
- 📝 Centralized Logging - Advanced logging system for debugging and monitoring
- 🔐 Key Integrity Validation - Comprehensive cryptographic key validation and signature verification
- 📦 Lightweight - Minimal dependencies and optimized for performance
- 🎯 TypeScript - Full TypeScript support with detailed type definitions
- 🔄 New Architecture - Compatible with React Native's new architecture (ExpoModules)
- 🚀 Easy Integration - Simple setup with comprehensive documentation
- 🔐 Secure by Default - Industry-standard security practices built-in
Installation in managed Expo projects
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.
Installation in bare React Native projects
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
Add the package to your npm dependencies
npx expo install "@mahibhaque/expo-biometrics"⚠️ Important: The module requires development builds (
npx expo run:ios --device) or (npx expo run:android --device). Does not work with Expo Go and Xcode simulator or Android Simulator.Prerequisites: macOS, Xcode 14+, Expo SDK 50+, iOS 14+.
Configure for Android
No additional set up necessary.
This module requires permissions to access the biometric data for authentication purposes. The USE_BIOMETRIC and USE_FINGERPRINT permissions are automatically added.
<!-- Added permissions -->
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />Configure for iOS
Run npx pod-install after installing the npm package.
Add NSFaceIDUsageDescription to your Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>Allow $(PRODUCT_NAME) to use FaceID</string>⚙️ Platform Notes
iOS supports
Face IDandTouch IDdepending on the device model.Android supports
Fingerprint,Facial Recognition, andIrisdepending on hardware.On Android, you can use the
requireConfirmationflag to request explicit user confirmation after successful biometric authentication.On iOS, you can customize the fallback button label using
fallbackLabel.
📚 Documentation
- Usage - Comprehensive guide to primary methods in the library, and how to properly use the library and it's API methods.
📄 License
This project is licensed under the MIT License.
