Verwendung

Write, read and protect a secret

Dieser Typ wird verwendet von 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',
});

Typdeklaration

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;
};

Mitglieder 4

NameTypErforderlichBeschreibung
keychainServicestringNeinKeeps a separate set of secrets: the iOS Keychain service. Defaults to 'app'.
keychainAccessibleAccessibilityNeinDefaults to 'whenUnlocked'.
requireAuthenticationbooleanNeinAsk for biometrics to read the secret, and on Android to write it.
authenticationPromptstringNeinWhat the biometric prompt says.
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.