Registry / storage / koa-session-redis-store

koa-session-redis-store

JSON →
library1.0.5jsnpmunverified

Redis store for koa-session, version 1.0.5. This package provides a Redis-backed storage adapter for the koa-session middleware in Koa applications. It allows session data to be persisted in Redis, enabling shared sessions across multiple server instances. The store is designed for Node.js >=4.8.7 and works with koa-session. Compared to other session stores, it leverages Redis for speed and scalability. The library is minimal with no external dependencies beyond Redis and koa-session. However, the repository appears to have no recent activity since 2019, and the package lacks TypeScript typings.

npm install koa-session-redis-store
INSTALL
IMPORT
SIG · KOA-SESSION-REDIS-
K
koa-session-redis-store
storagejavascriptv1.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import RedisStore from 'koa-session-redis-store'
const RedisStore = require('koa-session-redis-store').default
Uses default export; require works with no default needed.
default (CommonJS)
const RedisStore = require('koa-session-redis-store')
const { RedisStore } = require('koa-session-redis-store')
CommonJS require returns the default export directly.
Session configuration
import session from 'koa-session'; import RedisStore from 'koa-session-redis-store'
import * as session from 'koa-session'
koa-session also uses default export.

Shows how to set up koa-session with Redis store, using async/await and Koa framework.

import Koa from 'koa'; import session from 'koa-session'; import RedisStore from 'koa-session-redis-store'; const app = new Koa(); app.keys = ['your-secret-key']; const CONFIG = { key: 'koa.sess', maxAge: 86400000, overwrite: true, httpOnly: true, signed: true, store: new RedisStore({ host: 'localhost', port: 6379, password: process.env.REDIS_PASSWORD ?? '', db: 0 }) }; app.use(session(CONFIG, app)); app.use(ctx => { if (ctx.path === '/set') { ctx.session.user = 'Alice'; ctx.body = 'Session set'; } else if (ctx.path === '/get') { ctx.body = `Hello ${ctx.session.user}`; } }); app.listen(3000);
Debug
Known issues
deprecatedThis package has been deprecated; not actively maintained since 2019.
fix
Consider using koa-redis or koa-session directly with ioredis.
affects: >=1.0.0
gotchaMissing TypeScript type definitions - may cause TypeScript compilation errors.
fix
Create a declaration file (declare module 'koa-session-redis-store') or use a type-safe alternative.
affects: >=1.0.0
breakingRequires Node.js >=4.8.7; may not work with modern Node versions if native ES module support is needed.
fix
Upgrade to a maintained package that supports modern Node.js.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'koa-session-redis-store'
Package not installed or import path incorrect.
fix
Run `npm install koa-session-redis-store` and ensure the import is correct: import RedisStore from 'koa-session-redis-store'
TypeError: RedisStore is not a constructor
Using destructured import when package exports default.
fix
Use default import: import RedisStore from 'koa-session-redis-store'
TypeError: Cannot read property 'get' of undefined (or similar session store error)
Redis connection failure or incorrect configuration.
fix
Verify Redis server is running and configure store with correct host, port, and password.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
30
OpenAI (training)
1
Resources
koa-session-redis-store — npm install koa-session-redis-store · libregistry