
Modern, production-ready Redis integration for NestJS. Unified APIs, type-safe, and built on the official node-redis client.
NestJS Redis Toolkit is a cohesive set of utilities for Redis in NestJS applications. It provides a consistent developer experience across client connections, throttling storage, health checks, and distributed locking.
- Future‑proof: built on the actively maintained node-redis client
- Consistent APIs: NestJS-first patterns and DI integration
- Production-ready: lifecycle management and clear, minimal APIs
- @nestjs-redis/kit — All-in-one convenience package that bundles all toolkit modules
- @nestjs-redis/client — Redis client module with multi-connection support
- @nestjs-redis/lock — Distributed locking via Redlock
- @nestjs-redis/throttler-storage — Redis storage for NestJS Throttler
- @nestjs-redis/health-indicator — Redis health checks for Terminus
Install the kit and the Redis driver:
npm install @nestjs-redis/kit redis
Minimal setup:
// app.module.ts
import { Module } from '@nestjs/common';
import { RedisModule } from '@nestjs-redis/kit';
@Module({
imports: [
RedisModule.forRoot({
options: { url: 'redis://localhost:6379' },
}),
],
})
export class AppModule {}
// app.service.ts
import { Injectable } from '@nestjs/common';
import { InjectRedis, type Redis } from '@nestjs-redis/kit';
@Injectable()
export class AppService {
constructor(@InjectRedis() private readonly redis: Redis) {}
async setValue(key: string, value: string) {
await this.redis.set(key, value);
}
async getValue(key: string) {
return this.redis.get(key);
}
}
For most users, @nestjs-redis/kit
is the simplest way to get started. If you only need a single capability, you can install a specific package directly.
npm install @nestjs-redis/client redis
import { RedisModule } from '@nestjs-redis/client';
Package | Node.js | NestJS | Redis |
---|---|---|---|
@nestjs-redis/kit |
18+ | 9+ | 5+ |
@nestjs-redis/client |
18+ | 9+ | 5+ |
@nestjs-redis/throttler-storage |
18+ | 9+ | 5+ |
@nestjs-redis/health-indicator |
18+ | 9+ | 5+ |
@nestjs-redis/lock |
18+ | 9+ | 5+ |
All packages support NestJS 9.x, 10.x, and 11.x.
- Unified, NestJS-first Redis experience across multiple use cases (client, throttling, health, locks)
- Built on the official
node-redis
client for long-term maintenance and compatibility - Clean APIs with strong TypeScript types and DI-friendly patterns
- Production-ready lifecycle management (connect/disconnect) and clear error surfaces
- Minimal, consistent package READMEs so teams can onboard fast
Most NestJS Redis libraries were historically built on ioredis
. While ioredis
remains stable, maintenance is best-effort and the Redis team recommends node-redis
for new projects. node-redis
is actively maintained, redesigned from the ground up, and supports new and upcoming Redis features (including Redis Stack and Redis 8 capabilities). This toolkit exists to offer first‑class NestJS integrations on top of node-redis
rather than ioredis
.
Reference: redis/ioredis (GitHub)
- Documentation: see each package README above
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- npm:
@nestjs-redis
on npm
Contributions are welcome! Please read the contributing guide in the repository and open issues/PRs with clear context and reproduction steps.
MIT © CSenshi