secureStore.set
Stores value under key, replacing the secret and its options.
Utilização
Keep a token available to background work after the first unlock.
// Keep a token available to background work after the first unlock.
import { secureStore, type KeychainAccessibility } from 'kuito';
export async function saveSession(token: string) {
const accessibility: KeychainAccessibility = 'afterFirstUnlock';
await secureStore.set('session-token', token, { keychainAccessible: accessibility });
}
// The accessibility setting applies to the iOS Keychain.Assinaturas
(key: string, value: string, options?: SecureStoreOptions): Promise<void>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
key | string | Sim | — |
value | string | Sim | — |
options | SecureStoreOptions | Não | — Predefinição: {} |
Devolve
Promise<void>
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.