An open API service indexing awesome lists of open source software.

https://github.com/aeharding/capacitor-biometric-lock


https://github.com/aeharding/capacitor-biometric-lock

Last synced: 10 months ago
JSON representation

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 |