Skip to main content
‹ Device capabilities
Constants

BiometryType

A biometric modality that can unlock a key, as getBiometryTypes reports it: Face ID, Touch ID and Optic ID on iOS; fingerprint, face and iris on Android. A constant object and a type of the same name.

Import
import { BiometryType } from '@apexnative/keychain';

Usage​

import { BiometryType, getBiometryTypes } from '@apexnative/keychain';

const hasFace = (await getBiometryTypes()).includes(BiometryType.FaceID);

Signature​

const BiometryType: {
readonly FaceID: 'faceID';
readonly TouchID: 'touchID';
readonly OpticID: 'opticID';
readonly Fingerprint: 'fingerprint';
readonly Face: 'face';
readonly Iris: 'iris';
};

type BiometryType = (typeof BiometryType)[keyof typeof BiometryType];
Type'faceID' | 'touchID' | 'opticID' | 'fingerprint' | 'face' | 'iris'PlatformsiOSAndroid

Values​

ConstantStringPlatformWhat
FaceID'faceID'iOSFace ID
TouchID'touchID'iOSTouch ID
OpticID'opticID'iOSOptic ID, on Apple Vision Pro
Fingerprint'fingerprint'AndroidA fingerprint sensor
Face'face'AndroidFace recognition
Iris'iris'AndroidIris recognition

An iOS device reports one value at most; an Android device may report several. BiometryType.FaceID is the string 'faceID', so a comparison with either works.

See also​