SecureStoreOptions
Chooses where a secret lives, when it can be read, and whether biometrics guard it.
Usage
Write, read and protect a secret
This type is used by secureStore.delete
import { secureStore } from 'kuito';
await secureStore.set('token', 's3cret');
await secureStore.get('token'); // 's3cret', or null
await secureStore.delete('token');
await secureStore.set('pin', '1234', {
keychainService: 'auth',
keychainAccessible: 'afterFirstUnlock',
requireAuthentication: true,
authenticationPrompt: 'Unlock your account',
});Type declaration
export type SecureStoreOptions = {
/** Keeps a separate set of secrets: the iOS Keychain service. Defaults to `'app'`. */
keychainService?: string;
/** Defaults to `'whenUnlocked'`. */
keychainAccessible?: KeychainAccessibility;
/** Ask for biometrics to read the secret, and on Android to write it. */
requireAuthentication?: boolean;
/** What the biometric prompt says. */
authenticationPrompt?: string;
};Members 4
| Name | Type | Required | Description |
|---|---|---|---|
keychainService | string | No | Keeps a separate set of secrets: the iOS Keychain service. Defaults to 'app'. |
keychainAccessible | Accessibility | No | Defaults to 'whenUnlocked'. |
requireAuthentication | boolean | No | Ask for biometrics to read the secret, and on Android to write it. |
authenticationPrompt | string | No | What the biometric prompt says. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.