Redis storage for Koa session middleware/cache with Sentinel and Cluster support, version 4.0.1. This package provides a session store for koa-generic-session using Redis, built on ioredis. v4 rewrite added Sentinel and Cluster support, switched from node_redis to ioredis, and requires ioredis as a peer dependency. Release cadence is sporadic; last release was in 2020. Key differentiator: native support for Redis Sentinel and Cluster via ioredis, unlike earlier versions or other Redis session stores.
npm install koa-redisVerified import paths — ran on the pinned version, not inferred.
Sets up a Koa app with session stored in Redis using koa-redis store.
Update redis options to ioredis format (e.g., 'host' instead of 'hostname', no 'auth_pass'—use 'password').
Install koa-generic-session and pass it as shown in usage examples.
Remove 'parser' option; configure cookies via koa-generic-session options.
Remove 'isRedisCluster' and provide 'nodes' and 'clusterOptions' instead.
Use either 'url' or individual host/port/db options, not both.
Set ttl in the store options: redisStore({ ttl: 3600 }) for 1 hour.Pass retryStrategy as part of redisOptions in clusterOptions.
npm install ioredis
In CommonJS: const redisStore = require('koa-redis'); In ESM: import redisStore from 'koa-redis';npm install koa-generic-session and add const session = require('koa-generic-session');Add isRedisCluster: true or provide nodes and clusterOptions in the store config.
Start Redis server or check host/port settings.