# @flowmoco/capacitor-biometric-keychain

> Uses Keychain and Keystore on ios and android respectively to give a secure localStorage like API that uses a biometric lock for read and update operations

Latest version **2.0.0** (published 2023-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flowmoco/capacitor-biometric-keychain
pnpm add @flowmoco/capacitor-biometric-keychain
yarn add @flowmoco/capacitor-biometric-keychain
bun add @flowmoco/capacitor-biometric-keychain
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-08-10 |
| First published | 2022-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 43 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Charlie Jacques |
| Maintainers | charlieflowmo, idesignpixels, flowmoco-ben |
| Keywords | capacitor, plugin, native |

## Links

- npm: https://www.npmjs.com/package/@flowmoco/capacitor-biometric-keychain
- Repository: https://github.com/flowmoco/capacitor-biometric-keychain
- Homepage: https://github.com/flowmoco/capacitor-biometric-keychain#readme
- Issues: https://github.com/flowmoco/capacitor-biometric-keychain/issues
- npm.io page: https://npm.io/package/@flowmoco/capacitor-biometric-keychain

## Recent versions

- 2.0.0 (latest) — 2023-08-10
- 1.0.0 — 2022-11-01
- 0.0.9 — 2022-10-27
- 0.0.8 — 2022-10-27
- 0.0.7 — 2022-10-27
- 0.0.6 — 2022-10-27
- 0.0.5 — 2022-10-26
- 0.0.4 — 2022-10-26
- 0.0.3 — 2022-10-26
- 0.0.2 — 2022-10-25
- 0.0.1 — 2022-10-25

## README

# capacitor-biometric-keychain

Uses Keychain and Keystore on ios and android respectively to give a secure localStorage like API that uses a biometric lock for read and update operations

Capacitor v5
Android minSdkVersion 23
iOS min version 13.0

## Install

```bash
npm install @flowmoco/capacitor-biometric-keychain
npx cap sync
```

## iOS
To enable FaceID, you must set the the NSFaceIDUsageDescription key.

```
<key>NSFaceIDUsageDescription</key>
<string>[Reason why your app needs FaceID]</string>
```

## Import
```typescript
import { BiometricNative } from "@flowmoco/capacitor-biometric-keychain";
```

## API

<docgen-index>

* [`getItem(...)`](#getitem)
* [`setItem(...)`](#setitem)
* [`removeItem(...)`](#removeitem)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### getItem(...)

```typescript
getItem(options: { key: string; }) => Promise<{ value: string; error?: any; }>
```

Async get an item from the secure storage. Will invoke device biometric authentication.

| Param         | Type                          |
| ------------- | ----------------------------- |
| **`options`** | <code>{ key: string; }</code> |

**Returns:** <code>Promise&lt;{ value: string; error?: any; }&gt;</code>

--------------------


### setItem(...)

```typescript
setItem(options: { key: string; value: string; }) => Promise<{ error?: any; }>
```

Async set an item in secure storage. Will invoke device biometric authentication on Android and only on iOS if overwriting an existing key.

| Param         | Type                                         |
| ------------- | -------------------------------------------- |
| **`options`** | <code>{ key: string; value: string; }</code> |

**Returns:** <code>Promise&lt;{ error?: any; }&gt;</code>

--------------------


### removeItem(...)

```typescript
removeItem(options: { key: string; }) => Promise<{ error?: any; }>
```

Async remove an item from the secure storage. Will not invoke device biometric authentication either platform.

| Param         | Type                          |
| ------------- | ----------------------------- |
| **`options`** | <code>{ key: string; }</code> |

**Returns:** <code>Promise&lt;{ error?: any; }&gt;</code>

--------------------

</docgen-api>

---
_Source: https://npm.io/package/@flowmoco/capacitor-biometric-keychain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
