Registry / storage / remix-redis-session

remix-redis-session

JSON →
library0.0.12jsnpmunverified

A lightweight library providing Redis-backed session storage for Remix applications. Version 0.0.12 is the latest stable release, with no frequent updates. It offers two ways to connect to Redis: via a config object or by passing an existing ioredis client. Unlike other session stores, it integrates directly with Remix's session abstraction and requires minimal configuration. The package ships TypeScript types and is designed for server-side use only.

npm install remix-redis-session
INSTALL
IMPORT
SIG · REMIX-REDIS-SESSIO
R
remix-redis-session
storagejavascriptv0.0.12
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.

createRedisSessionStorage
✓ import { createRedisSessionStorage } from 'remix-redis-session'
✗ import createRedisSessionStorage from 'remix-redis-session'
The library exports only a named export; default import will not work.

Shows how to create a Redis session storage instance and use it in a Remix app for getting and committing sessions.

import { createRedisSessionStorage } from 'remix-redis-session'; const sessionStorage = createRedisSessionStorage({ cookie: { name: 'session', secrets: ['s3cr3t'], secure: true, sameSite: 'lax', path: '/', httpOnly: true, }, options: { redisConfig: { host: process.env.REDIS_HOST ?? 'localhost', port: 6379, password: process.env.REDIS_PASSWORD ?? undefined, }, }, }); export async function getSession(request: Request) { const session = await sessionStorage.getSession(request.headers.get('Cookie')); return session; } export async function commitSession(session: any) { return sessionStorage.commitSession(session); }
Debug
Known issues
breakingThe library is version 0.0.12 and considered unstable; APIs may change without notice.
fix
Pin to a specific version and review changelog before upgrading.
affects: >=0.0.0
gotchaOnly named export is available; attempting default import results in 'undefined'.
fix
Use `import { createRedisSessionStorage } from 'remix-redis-session'`.
affects: >=0.0.0
deprecatedThe `SessionIdStorageStrategy['cookie']` type is outdated; use Remix's `SessionCookieOptions` or similar.
fix
Refer to Remix v2 documentation for updated cookie options typing.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'stringify' of 'undefined' as it is undefined.
Using default import instead of named import.
fix
Change import to `import { createRedisSessionStorage } from 'remix-redis-session'`.
Error: connect ECONNREFUSED ::1:6379
Redis server is not running or host/port are incorrect.
fix
Ensure Redis is running and accessible. Check `redisConfig.host` and `redisConfig.port`.
TypeError: sessionStorage.getSession is not a function
Passing an object without a valid cookie option or missing redisConfig/redisClient.
fix
Ensure `cookie` is provided with required fields (name, secrets) and either `redisConfig` or `redisClient` is set.
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies
ioredisrequiredRequired for Redis connection; the library uses ioredis internally when a config is provided, or accepts an external ioredis client.
@remix-run/server-runtimeoptionalPeer dependency for Remix session types and utilities.
Agent activity
35 hits · last 30 days
node
32
Amazon
1
Resources
remix-redis-session — npm install remix-redis-session · libregistry