https://github.com/danielsogl/capacitor-face-id
Allow users to authenticate with Face ID or Touch ID on iOS devices
https://github.com/danielsogl/capacitor-face-id
capacitor capacitor-plugin face-id ionic ios touch-id
Last synced: 6 months ago
JSON representation
Allow users to authenticate with Face ID or Touch ID on iOS devices
- Host: GitHub
- URL: https://github.com/danielsogl/capacitor-face-id
- Owner: danielsogl
- License: mit
- Created: 2019-09-15T09:39:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-20T06:25:14.000Z (7 months ago)
- Last Synced: 2025-03-28T13:06:11.332Z (7 months ago)
- Topics: capacitor, capacitor-plugin, face-id, ionic, ios, touch-id
- Language: Swift
- Homepage: https://danielsogl.github.io/capacitor-face-id/
- Size: 3.86 MB
- Stars: 104
- Watchers: 2
- Forks: 12
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Capacitor Face ID Plugin
[](https://badge.fury.io/js/capacitor-face-id)
Allow users to authenticate with Face ID or Touch ID on iOS devices

## Installation
```sh
npm install capacitor-face-id
```## iOS Notes
iOS requires the following usage description be added and filled out for your app in `Info.plist`:
Name: `Privacy - Face ID Usage Description`
Key: `NSFaceIDUsageDescription`## Example
```ts
import { Plugins, PluginResultError } from '@capacitor/core';const { FaceId } = Plugins;
...
// check if device supports Face ID or Touch ID
FaceId.isAvailable().then(checkResult => {
if(checkResult.value) {
FaceId.auth().then(() => {
console.log('authenticated');
}).catch((error: PluginResultError) => {
// handle rejection errors
console.error(error.message);
});
} else {
// use custom fallback authentication here
}
});```
## API
| Method | Default | Type | Description |
| --------------------------------- | --------------------------------------------------- | ---------------------------- | ------------------------------------------------------------------- |
| isAvailable() | | `Promise<{ value: string }>` | Checks if Face ID or Touch ID is available, and returns type if so. |
| auth(options?: {reason?: string}) | options: {reason: "Access requires authentication"} | `Promise` | Displays the Face ID or Touch ID screen |