secureStore.SecureStoreOptions
Chooses where a secret lives, when it can be read, and whether biometrics guard it.
Utilisation
Write, read and protect a secret
Ce type est utilisé par 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',
});Déclaration du type
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;
};Membres 4
| Nom | Type | Requis | Description |
|---|---|---|---|
keychainService | string | Non | Keeps a separate set of secrets: the iOS Keychain service. Defaults to 'app'. |
keychainAccessible | Accessibility | Non | Defaults to 'whenUnlocked'. |
requireAuthentication | boolean | Non | Ask for biometrics to read the secret, and on Android to write it. |
authenticationPrompt | string | Non | What the biometric prompt says. |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.