@auth0/ai-redis v1.0.0
Redis Store for Auth0 AI
@auth0/ai-redis
is a secure Redis-based data store implementation for the Auth0 AI SDK.
Install
!WARNING
@auth0/ai-redis
is currently under heavy development. We strictly follow Semantic Versioning (SemVer), meaning all breaking changes will only occur in major versions. However, please note that during this early phase, major versions may be released frequently as the API evolves. We recommend locking versions when using this in production.
$ npm install @auth0/ai-redis
Usage
Initialize the Redis store and use it with the Auth0 AI SDK:
import { RedisStore } from "@auth0/ai-redis";
import { Auth0AI } from "@auth0/ai-vercel"; //or ai-langchain, etc.
const auth0AI = new Auth0AI({
store: new RedisStore({
encryption: {
key: "YOUR_ENCRYPTION_KEY",
alg: "aes-256-cbc",
},
}),
});
RedisStore Options
The RedisStore
constructor accepts the following options:
- client: An existing
ioredis
client instance. - encryption (optional): Configuration for encrypting data stored in Redis.
key
: The encryption key (required ifencryption
is provided).alg
: The encryption algorithm. Supported values areaes-256-cbc
,aes-192-cbc
, andaes-128-cbc
. Defaults toaes-256-cbc
.
Alternatively, you can pass a configuration object compatible with ioredis
to initialize a new Redis client.
Example with an Existing Redis Client
import { Redis } from "ioredis";
import { RedisStore } from "@auth0/ai-redis";
const redisClient = new Redis();
const store = new RedisStore({
client: redisClient, //Optional: Default to `new Redis()`
encryption: {
key: "YOUR_ENCRYPTION_KEY",
},
});
Features
- Encryption: Securely encrypts data before storing it in Redis.
- Namespace Support: Organize keys using namespaces.
- Expiration: Supports setting expiration times for stored data.
Feedback
Contributing
We appreciate feedback and contributions to this repo! Before you get started, please see the following:
Raise an issue
To provide feedback or report a bug, please raise an issue on our issue tracker.
Vulnerability Reporting
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
6 months ago