@capgo/capacitor-native-biometric
Version:
This plugin gives access to the native biometric apis for android and iOS
131 lines • 5.44 kB
JavaScript
export var BiometryType;
(function (BiometryType) {
// Android, iOS
BiometryType[BiometryType["NONE"] = 0] = "NONE";
// iOS
BiometryType[BiometryType["TOUCH_ID"] = 1] = "TOUCH_ID";
// iOS
BiometryType[BiometryType["FACE_ID"] = 2] = "FACE_ID";
// Android
BiometryType[BiometryType["FINGERPRINT"] = 3] = "FINGERPRINT";
// Android
BiometryType[BiometryType["FACE_AUTHENTICATION"] = 4] = "FACE_AUTHENTICATION";
// Android
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
// Android
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
// Android - Device credentials (PIN, pattern, or password)
BiometryType[BiometryType["DEVICE_CREDENTIAL"] = 7] = "DEVICE_CREDENTIAL";
})(BiometryType || (BiometryType = {}));
export var AuthenticationStrength;
(function (AuthenticationStrength) {
/**
* No authentication available, even if PIN is available but useFallback = false
*/
AuthenticationStrength[AuthenticationStrength["NONE"] = 0] = "NONE";
/**
* Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).
* Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.
*/
AuthenticationStrength[AuthenticationStrength["STRONG"] = 1] = "STRONG";
/**
* Weak authentication: Face authentication on Android devices that consider face weak,
* or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).
*/
AuthenticationStrength[AuthenticationStrength["WEAK"] = 2] = "WEAK";
})(AuthenticationStrength || (AuthenticationStrength = {}));
export var AccessControl;
(function (AccessControl) {
/**
* No biometric protection. Credentials are accessible without authentication.
* This is the default behavior for backward compatibility.
*/
AccessControl[AccessControl["NONE"] = 0] = "NONE";
/**
* Biometric authentication required for credential access.
* Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).
* More secure but credentials are lost if user modifies their biometric enrollment.
*/
AccessControl[AccessControl["BIOMETRY_CURRENT_SET"] = 1] = "BIOMETRY_CURRENT_SET";
/**
* Biometric authentication required for credential access.
* Credentials survive new biometric enrollment (e.g., adding a new fingerprint).
* More lenient — recommended for most apps.
*/
AccessControl[AccessControl["BIOMETRY_ANY"] = 2] = "BIOMETRY_ANY";
})(AccessControl || (AccessControl = {}));
/**
* Biometric authentication error codes.
* These error codes are used in both isAvailable() and verifyIdentity() methods.
*
* Keep this in sync with BiometricAuthError in README.md
* Update whenever `convertToPluginErrorCode` functions are modified
*/
export var BiometricAuthError;
(function (BiometricAuthError) {
/**
* Unknown error occurred
*/
BiometricAuthError[BiometricAuthError["UNKNOWN_ERROR"] = 0] = "UNKNOWN_ERROR";
/**
* Biometrics are unavailable (no hardware or hardware error)
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["BIOMETRICS_UNAVAILABLE"] = 1] = "BIOMETRICS_UNAVAILABLE";
/**
* User has been locked out due to too many failed attempts
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["USER_LOCKOUT"] = 2] = "USER_LOCKOUT";
/**
* No biometrics are enrolled on the device
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["BIOMETRICS_NOT_ENROLLED"] = 3] = "BIOMETRICS_NOT_ENROLLED";
/**
* User is temporarily locked out (Android: 30 second lockout)
* Platform: Android
*/
BiometricAuthError[BiometricAuthError["USER_TEMPORARY_LOCKOUT"] = 4] = "USER_TEMPORARY_LOCKOUT";
/**
* Authentication failed (user did not authenticate successfully)
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["AUTHENTICATION_FAILED"] = 10] = "AUTHENTICATION_FAILED";
/**
* App canceled the authentication (iOS only)
* Platform: iOS
*/
BiometricAuthError[BiometricAuthError["APP_CANCEL"] = 11] = "APP_CANCEL";
/**
* Invalid context (iOS only)
* Platform: iOS
*/
BiometricAuthError[BiometricAuthError["INVALID_CONTEXT"] = 12] = "INVALID_CONTEXT";
/**
* Authentication was not interactive (iOS only)
* Platform: iOS
*/
BiometricAuthError[BiometricAuthError["NOT_INTERACTIVE"] = 13] = "NOT_INTERACTIVE";
/**
* Passcode/PIN is not set on the device
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["PASSCODE_NOT_SET"] = 14] = "PASSCODE_NOT_SET";
/**
* System canceled the authentication (e.g., due to screen lock)
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["SYSTEM_CANCEL"] = 15] = "SYSTEM_CANCEL";
/**
* User canceled the authentication
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["USER_CANCEL"] = 16] = "USER_CANCEL";
/**
* User chose to use fallback authentication method
* Platform: Android, iOS
*/
BiometricAuthError[BiometricAuthError["USER_FALLBACK"] = 17] = "USER_FALLBACK";
})(BiometricAuthError || (BiometricAuthError = {}));
//# sourceMappingURL=definitions.js.map