@auth0/ai-redis
is a secure Redis-based data store implementation for the Auth0 AI SDK.
[!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
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",
},
}),
});
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.
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",
},
});
- Encryption: Securely encrypts data before storing it in Redis.
- Namespace Support: Organize keys using namespaces.
- Expiration: Supports setting expiration times for stored data.
We appreciate feedback and contributions to this repo! Before you get started, please see the following:
To provide feedback or report a bug, please raise an issue on our issue tracker.
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?
This project is licensed under the Apache 2.0 license. See the LICENSE file for more info.