Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 days 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-21T17:38:02.000Z (16 days ago)
- Last Synced: 2025-01-24T20:14:19.033Z (13 days 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: 103
- Watchers: 3
- Forks: 12
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Capacitor Face ID Plugin
[![npm version](https://badge.fury.io/js/capacitor-face-id.svg)](https://badge.fury.io/js/capacitor-face-id)
![Build](https://github.com/danielsogl/capacitor-face-id/workflows/Build/badge.svg)Allow users to authenticate with Face ID or Touch ID on iOS devices
![Logo](https://www.intego.com/mac-security-blog/wp-content/uploads/2017/10/Touch-ID-vs-Face-ID.png)
## 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 |