A Node.js wrapper for encrypting and decrypting data stored in Redis using AES-256-GCM encryption with unique IVs per entry. Currently at version 4.1.3, actively maintained. Key differentiators include built-in secret key validation via SecretValidator, support for both Redis connection options and existing ioredis clients (including Cluster), automatic UUID-based prefixing, and ESM-only with TypeScript types. Provides simple save/get/delete operations on serialized JSON objects with strong encryption.
npm install secure-store-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an encrypted Redis store, saves and retrieves a JSON object, then disconnects. Uses auto-generated secret and default Redis connection.
Update config to use `redis: { url: 'redis://...' }` or pass an existing ioredis client as `redis: { client: myClient }`.Use `SecretValidator.generate()` to produce a valid 32-character secret, or set `allowWeakSecrets: true` in the constructor (not recommended).
Always call `redis.quit()` after you are done with the store to cleanly close the client.
Choose a unique `uid` for each application to avoid key collisions.
Update imports: `import SecureStore from 'secure-store-redis'` and `import { SecretValidator } from 'secure-store-redis'`.Use `import { SecretValidator } from 'secure-store-redis'`Generate a valid secret: `const secret = SecretValidator.generate();` or set `allowWeakSecrets: true` in options.
Start Redis locally or provide correct `redis.url`. Example: `redis: { url: 'redis://localhost:6379' }`Switch to ESM: use `import` syntax, or use dynamic import: `const SecureStore = await import('secure-store-redis');`