Necessarily Precedes Mischief

    remix-redis-session
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.11 • Public • Published

    remix-redis-session

    A simple library to use redis as your session backing store in your remix project

    Install

    npm install remix-redis-session or yarn add remix-redis-session

    Api

    createRedisSessionStorage({
        cookie: SessionIdStorageStrategy["cookie"]
        options: {
            redisConfig?: Redis.RedisOptions,
            redisClient?: Redis.Redis
        }
    })

    Examples

    // With redisConfig
    export const sessionStorage = createRedisSessionStorage({
        cookie: {
            name: "example",
            secure: true,
            sameSite: "lax",
            secrets: ["s3cr3t"],
            path: "/",
            httpOnly: true,
        },
        options: {
            redisConfig: {
                port: 6379,
                family: 6,
                host: process.env.REDIS_HOST,
                password: process.env.REDIS_PASSWORD ?? undefined,
            }
        }
    });
    
    // With redisClient
    const redis = new Redis({
        port: 6379,
        family: 6,
        host: process.env.REDIS_HOST,
        password: process.env.REDIS_PASSWORD ?? undefined,
    });
    
    export const sessionStorage = createRedisSessionStorage({
        cookie: {
            name: "example",
            secure: true,
            sameSite: "lax",
            secrets: ["s3cr3t"],
            path: "/",
            httpOnly: true,
        },
        options: {
            redisClient: redis
        }
    });

    Buy me a coffee :)

    ❤️ Sponsor

    Keywords

    none

    Install

    npm i remix-redis-session

    DownloadsWeekly Downloads

    317

    Version

    0.0.11

    License

    MIT

    Unpacked Size

    6.79 kB

    Total Files

    5

    Last publish

    Collaborators

    • dalperin