https://github.com/thang2162/react-native-biometric-login
A React Native module that enables biometric authentication and securely stores user credentials using native APIs. This library provides a comprehensive solution for implementing biometric login functionality in React Native applications with support for both iOS and Android platforms.
https://github.com/thang2162/react-native-biometric-login
android auth authentication credential-storage encryptedsharedpreferences face fingerprint fingerprint-authentication fingerprint-sensor ios keychain kotlin react react-native swift touch touchid
Last synced: 3 months ago
JSON representation
A React Native module that enables biometric authentication and securely stores user credentials using native APIs. This library provides a comprehensive solution for implementing biometric login functionality in React Native applications with support for both iOS and Android platforms.
- Host: GitHub
- URL: https://github.com/thang2162/react-native-biometric-login
- Owner: thang2162
- License: mit
- Created: 2022-08-09T19:56:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-19T16:50:58.000Z (10 months ago)
- Last Synced: 2025-09-22T15:52:19.446Z (9 months ago)
- Topics: android, auth, authentication, credential-storage, encryptedsharedpreferences, face, fingerprint, fingerprint-authentication, fingerprint-sensor, ios, keychain, kotlin, react, react-native, swift, touch, touchid
- Language: C++
- Homepage:
- Size: 2.92 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-biometric-login
A React-Native module to enable biometric login and securely store a user's credentials using native apis. The user's credentials are encrypted and stored using Keychain on iOS and Encrypted Shared Preferences on Android.
## Installation
```sh
npm install react-native-biometric-login --save
cd ios && pod install && cd ..
```
or
```sh
yarn add react-native-biometric-login
cd ios && pod install && cd ..
```
## Usage
```js
import {
BiometricIsAvailable,
BasicBiometricAuth,
LoginBiometricAuth,
SetUser,
UpdateUser,
GetUser,
DeleteUser,
} from 'react-native-biometric-login';
// ...
const result = await BiometricIsAvailable();
```
## API
1. BiometricIsAvailable() - Checks if a biometric authentication method is available on the device.
Returns: Promise that resolves with true or false
2. BasicBiometricAuth(title: string, description: string) - Opens a basic biometric login prompt.
Returns: Promise that resolves with true if success or rejects with message if fail.
3. LoginBiometricAuth(title: string, description: string) - Opens a biometric login prompt that returns stored user credentials.
Returns: Promise that resolves with object {success: true, username: "username", password: "password"} if success or rejects with message if fail.
4. SetUser(username: string, password: string) - Save the user's credentials.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
5. UpdateUser(username: string, password: string) - Update the user's credentials.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
6. GetUser() - Gets the user's credentials.
Returns: Promise that resolves with object {success: true, username: "username", password: "password"} if success or rejects with message if fail.
7. DeleteUser() - Deletes the user's credentials.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT