useSecureStorage
The useSecureStorage hook provides functions to interact with secure storage for sensitive data. You can use this for authentication tokens or any sensitive data that requires hardware-backed encryption.
You can only store one secret per Mini.
You can only store one secret per Mini.
Use useSecureStorage for sensitive data like auth tokens, API keys, or PII. It provides hardware-backed encryption on both iOS and Android, ensuring data is protected even if the device is compromised. The tradeoff is slower performance and a limit of one secret per Mini. Use useAsyncStorage for non-sensitive data like preferences or cached content. It supports multiple key-value pairs and is ~3x faster, but stores data in plaintext.
Use useSecureStorage for sensitive data like auth tokens, API keys, or PII. It provides hardware-backed encryption on both iOS and Android, ensuring data is protected even if the device is compromised. The tradeoff is slower performance and a limit of one secret per Mini. Use useAsyncStorage for non-sensitive data like preferences or cached content. It supports multiple key-value pairs and is ~3x faster, but stores data in plaintext.
Anchor to useSecureStorageuse Secure Storage()
UseSecureStorageReturns
- getSecret
Get the secret from the secure storage.
() => Promise<string> - removeSecret
Remove the secret from the secure storage.
() => Promise<void> - setSecret
Set a secret in the secure storage.
(params: SetSecretParams) => Promise<void>
SetSecretParams
- value
string