Skip to main content
🔐

Secure Storage

Security
View Docs

Encrypted key-value storage for sensitive data

keychainencryptedstoragecredentialstokens

Demo

Store a Value

Stored Keys

No keys stored. Click "Refresh" to load or store some values.

Note: On native platforms (iOS/Android), data is stored in the Keychain (iOS) or EncryptedSharedPreferences (Android) for maximum security. On web browsers, it falls back to localStorage which is less secure but allows testing the API.

Usage

import { useSecureStorage } from '@classic-homes/native/svelte';
// or for React:
import { useSecureStorage } from '@classic-homes/native/react';

API Reference

PropertyTypeDescription
isLoadingbooleanWhether a storage operation is in progress
errorError | nullCurrent error if any
get(key: string) => Promise<string | null>Get a value from storage
set(key: string, value: string) => Promise<void>Set a value in storage
remove(key: string) => Promise<void>Remove a value from storage
clear() => Promise<void>Clear all stored values
keys() => Promise<string[]>Get all stored keys

Related Features