native-keychain
v1.1.0
Published
A native keychain module for Node.js written in Swift and TypeScript
Downloads
5
Readme
Node Native Keychain
This is a TypeScript library to store and retrieve secure information from the macos keychain. It is a wrapper around the native keychain APIs on macOS built in Swift and bindings with Koffi.
Installation
npm install native-keychain
Usage
Note: For the moment, we only store Generic passwords in the keychain.
import * as keychain from 'native-keychain';
keychain.setPassword({ service: 'my-service', password: 'my-password' });
const secret = await keychain.getPassword({ service: 'my-service', requireBiometrics: true }); // 'my-password'
Available methods
| Method | Description | Output |
| ------------------------------- | -------------------------------------- | ------------------ |
| getPassword
| Retrieve a password from the keychain. | Promise<string>
|
| setPassword
| Store a password in the keychain. | void
|
| deletePassword
| Delete a password from the keychain. | void
|
| isBiometricsSupported
| Check if biometrics is supported. | boolean
|
| requestBiometricsVerification
| Request biometrics verification. | Promise<boolean>
|
Maintainer
| | | --------------------------------------------------------------------------------------------------------------------------- | | Corentin Mors |