https://github.com/aeharding/capacitor-biometric-lock
https://github.com/aeharding/capacitor-biometric-lock
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aeharding/capacitor-biometric-lock
- Owner: aeharding
- Created: 2023-11-13T02:10:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T01:46:31.000Z (over 1 year ago)
- Last Synced: 2025-08-03T15:35:12.815Z (about 1 year ago)
- Language: Swift
- Size: 258 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# capacitor-biometric-lock
Lock and unlock an app with biometrics
## Install
```bash
npm install capacitor-biometric-lock
npx cap sync
```
## API
* [`configure(...)`](#configure)
* [`getConfiguration()`](#getconfiguration)
* [`getBiometricMethod()`](#getbiometricmethod)
* [Interfaces](#interfaces)
* [Enums](#enums)
### configure(...)
```typescript
configure(options?: BiometricLockConfiguration | undefined) => Promise
```
Set plugin configuration
| Param | Type |
| ------------- | --------------------------------------------------------------------------------- |
| **`options`** | BiometricLockConfiguration |
**Since:** 1.0.0
--------------------
### getConfiguration()
```typescript
getConfiguration() => Promise
```
Get plugin configuration
**Returns:** Promise<BiometricLockConfiguration>
**Since:** 1.0.0
--------------------
### getBiometricMethod()
```typescript
getBiometricMethod() => Promise
```
Get primary biometric method
**Returns:** Promise<BiometricMethodResult>
**Since:** 1.0.0
--------------------
### Interfaces
#### BiometricLockConfiguration
Persisted configuration of the plugin
| Prop | Type | Description |
| ---------------------- | -------------------- | ---------------------------- |
| **`enabled`** | boolean | |
| **`timeoutInSeconds`** | number | |
| **`appName`** | string | |
| **`retryButtonColor`** | string | Hex color code e.g. "00ffee" |
#### BiometricMethodResult
| Prop | Type |
| --------------------- | ----------------------------------------------------------- |
| **`biometricMethod`** | BiometricMethod |
### Enums
#### BiometricMethod
| Members | Value | Description |
| ------------------------------- | -------------- | ----------------------------------------------- |
| **`none`** | 0 | No biometry is available |
| **`touchId`** | 1 | iOS Touch ID is available |
| **`faceId`** | 2 | iOS Face ID is available |
| **`fingerprintAuthentication`** | 3 | Android fingerprint authentication is available |
| **`faceAuthentication`** | 4 | Android face authentication is available |
| **`irisAuthentication`** | 5 | Android iris authentication is available |