Session management using Redis and JWT for horizontal scalability. Current version is 1.4.0. Provides both single-session and multi-session support per user, with token signing/verification and optional session data storage in Redis. Differentiates by combining JWT with Redis for session persistence and scaling, unlike pure JWT or pure Redis-session approaches. Requires Node >=6.x and Redis >=3.x.
npm install redis-jwtNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic sign and verify using RedisJwt with default settings and custom TTL/token data.
Upgrade Node.js to version 8 or later.
Initialize RedisJwt with `multiple: true` if multiple sessions per user are required.
Always provide a `secret` string when creating an instance.
Use a string with unit (e.g., '15 minutes', '1 hour') for TTL.
Only use `verify(token, true)` when you need session data from Redis; for simple token validation, omit the second argument.
Upgrade to >=1.0.0 and adapt code to the new API: new RedisJwt(options), sign/verify methods.
Add `secret: 'your-secret-key'` to the options object.
Ensure Redis is running on the specified host and port. Check firewall settings.
Use `import RedisJwt from 'redis-jwt'` (ESM) or `const RedisJwt = require('redis-jwt')` (CJS), then create an instance with `new RedisJwt(...)`.Verify the token was generated by the same secret. Check for extra spaces or truncation.