
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
expo-local-authentication
Advanced tools
Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.
The expo-local-authentication package provides an API for authenticating users using biometric methods such as fingerprint, facial recognition, or iris recognition on devices that support these features. It is part of the Expo ecosystem, which is designed to work seamlessly with React Native applications.
Check if hardware supports local authentication
This feature allows you to check if the device has the necessary hardware to support local authentication methods like fingerprint or facial recognition.
import * as LocalAuthentication from 'expo-local-authentication';
async function checkHardware() {
const hasHardware = await LocalAuthentication.hasHardwareAsync();
console.log('Hardware available:', hasHardware);
}
Check if biometrics are enrolled
This feature checks if the user has enrolled any biometric data (e.g., fingerprints or face) on their device.
import * as LocalAuthentication from 'expo-local-authentication';
async function checkBiometrics() {
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
console.log('Biometrics enrolled:', isEnrolled);
}
Authenticate using biometrics
This feature initiates the biometric authentication process, prompting the user to authenticate using their enrolled biometric data.
import * as LocalAuthentication from 'expo-local-authentication';
async function authenticate() {
const result = await LocalAuthentication.authenticateAsync();
console.log('Authentication result:', result);
}
The react-native-touch-id package provides similar functionality for biometric authentication, focusing primarily on Touch ID and Face ID for iOS devices. It offers a straightforward API for integrating biometric authentication into React Native apps, but it may require additional setup for Android support compared to expo-local-authentication.
This package provides a more comprehensive solution for fingerprint scanning across both iOS and Android platforms. It offers more detailed configuration options and error handling compared to expo-local-authentication, but it may require more manual setup and linking in a React Native project.
Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.
For bare React Native projects, you must ensure that you have installed and configured the expo
package before continuing.
npx expo install expo-local-authentication
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" />
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>
Contributions are very welcome! Please refer to guidelines described in the contributing guide.
FAQs
Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.
The npm package expo-local-authentication receives a total of 126,072 weekly downloads. As such, expo-local-authentication popularity was classified as popular.
We found that expo-local-authentication demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 31 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.