SecureStoreOptions
Chooses where a secret lives, when it can be read, and whether biometrics guard it.
Utilização
Write, read and protect a secret
Este tipo é usado por 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',
});Declaração do tipo
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;
};Membros 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
keychainService | string | Não | Keeps a separate set of secrets: the iOS Keychain service. Defaults to 'app'. |
keychainAccessible | Accessibility | Não | Defaults to 'whenUnlocked'. |
requireAuthentication | boolean | Não | Ask for biometrics to read the secret, and on Android to write it. |
authenticationPrompt | string | Não | What the biometric prompt says. |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.