finds.dev← search

// the find

tj/connect-redis

★ 2,824 · TypeScript · MIT · updated Aug 2025

Redis session store for Connect

connect-redis is a Redis-backed session store for express-session. Single-file implementation (~150 lines) that wraps a redis client and implements the SessionStore interface. If you're running Express with express-session and want sessions in Redis, this is the standard choice.

The entire implementation is one file, so there's nothing to get lost in — you can read the whole thing in five minutes and understand exactly what it does. TTL handling is correct: it uses the cookie expiry when present and falls back to a configurable default, resetting on touch. The custom serializer option is genuinely useful if you need to store non-JSON-serializable types or add encryption at the store layer. TypeScript types are bundled; no separate @types package to keep in sync.

The SCAN-based bulk operations (all, keys, ids) are inherently slow on large keyspaces — iterating with SCAN to find all sessions by prefix doesn't scale, and the scanCount default of 100 won't help you if you have millions of sessions. There's no connection error handling in the store itself; if the Redis client disconnects, sessions fail silently depending on how your client is configured. The package still requires you to wire up express-session separately, which means two packages doing half a job each — this is a Node ecosystem problem, not specific to this library, but worth knowing. No support for Redis Cluster or Sentinel at the store level; you'd need to configure that on the client before passing it in.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →