cfi

capacitor-face-id

Allow users to authenticate with Face ID or Touch ID on iOS devices

Showing:

Popularity

Downloads/wk

160

GitHub Stars

60

Maintenance

Last Commit

3d ago

Contributors

7

Package

Dependencies

1

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

Capacitor Face ID Plugin

npm version Build

Allow users to authenticate with Face ID or Touch ID on iOS devices

Logo

Installation

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

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

MethodDefaultTypeDescription
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<void>Displays the Face ID or Touch ID screen

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100