Usage

Write, read and protect a secret

This type is used by secureStore.delete

tsx
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

ts
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

NameTypeRequiredDescription
keychainServicestringNoKeeps a separate set of secrets: the iOS Keychain service. Defaults to 'app'.
keychainAccessibleAccessibilityNoDefaults to 'whenUnlocked'.
requireAuthenticationbooleanNoAsk for biometrics to read the secret, and on Android to write it.
authenticationPromptstringNoWhat 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.