- IndexedDB-backed key-value store with non-extractable AES-256-GCM CryptoKey - Key material never leaves browser crypto subsystem - API: set, get, delete, clear, has, keys — all async - Namespace isolation for multi-app usage - Falls back to localStorage when SubtleCrypto unavailable - 16 Vitest tests (fake-indexeddb), all passing - Add IndexedDB globals to root ESLint config
20 lines
578 B
TypeScript
20 lines
578 B
TypeScript
/**
|
|
* @bytelyst/secure-storage-web
|
|
*
|
|
* Encrypted key-value storage for web applications.
|
|
* Uses IndexedDB + Web Crypto (non-extractable AES-256-GCM key).
|
|
* Falls back to localStorage when SubtleCrypto is unavailable.
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* import { SecureStorage } from '@bytelyst/secure-storage-web';
|
|
*
|
|
* const storage = new SecureStorage('com.myapp');
|
|
* await storage.set('auth_token', 'eyJhbGci...');
|
|
* const token = await storage.get('auth_token');
|
|
* await storage.delete('auth_token');
|
|
* ```
|
|
*/
|
|
|
|
export { SecureStorage } from './secure-storage.js';
|