Secure, encrypted localStorage with the Web Crypto API
// Decrypted data will appear here
View all keys currently in MikroSafe
| Key | Encrypted Data (preview) | Actions |
|---|
No items in storage
// Create a storage instance with a password
const storage = new MikroSafe('my-secure-password');
// Store data (returns a Promise)
await storage.setItem('userProfile', {
name: 'Alice',
role: 'Admin'
});
// Retrieve data (returns a Promise)
const profile = await storage.getItem('userProfile');
// Remove data
storage.removeItem('userProfile');
// Clear all data
storage.clear();