GitPedia

Nestjs redis

🛠 Modular Redis toolkit for NestJS: Client, RedLock and more

From CSenshi·Updated June 26, 2026·View on GitHub·

Modern, production-ready Redis integration for NestJS. Unified APIs, type-safe, and built on the official node-redis client. The project is written primarily in TypeScript, distributed under the MIT License license, first published in 2025. Key topics include: check, distributed, health, indicator, kit.

Latest release: v1.3.0
June 14, 2026View Changelog →
<div align="center"> <img src="docs/images/logo.png" alt="NestJS Redis Toolkit Logo" width="200" height="200">

🚀 NestJS Redis Toolkit

Modern, production-ready Redis integration for NestJS. Unified APIs, type-safe, and built on the official node-redis client.

Build Status
License: MIT
TypeScript
NestJS
Redis

</div>

Overview

NestJS Redis Toolkit is a cohesive set of utilities for Redis in NestJS applications. It provides a consistent developer experience across client connections, microservices transport (Redis Streams), 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

Learn more

Curious about the story behind this toolkit and how it simplifies Redis in NestJS? Read the introduction on Medium:
👉 The Missing Redis Toolkit for NestJS

Packages

Quick Start

Install the packages you need. For a minimal Redis client setup:

bash
npm install @nestjs-redis/client redis

Minimal setup:

typescript
// app.module.ts import { Module } from '@nestjs/common'; import { RedisModule } from '@nestjs-redis/client'; @Module({ imports: [ RedisModule.forRoot({ options: { url: 'redis://localhost:6379' }, }), ], }) export class AppModule {}
typescript
// app.service.ts import { Injectable } from '@nestjs/common'; import { InjectRedis } from '@nestjs-redis/client'; import type { RedisClientType } from 'redis'; @Injectable() export class AppService { constructor(@InjectRedis() private readonly redis: RedisClientType) {} async setValue(key: string, value: string) { await this.redis.set(key, value); } async getValue(key: string) { return this.redis.get(key); } }

For health checks, throttling, locks, Socket.IO, or microservices transport, install the corresponding packages and see their READMEs.

Debug Logging

Enable detailed logging across all toolkit packages by setting the REDIS_MODULE_DEBUG environment variable:

bash
REDIS_MODULE_DEBUG=true npm start

This provides comprehensive operational logging:

[RedisModule] [Connection=<empty>]: Creating Redis client...
[RedisModule] [Connection=<empty>]: [Event=connect] Connection initiated to Redis server
[RedisModule] [Connection=<empty>]: [Event=ready] Redis client is ready to accept commands
[RedisModule] [Connection=<empty>]: Redis client connected

Compatibility

PackageNode.jsNestJSRedis
@nestjs-redis/client18+9+5+
@nestjs-redis/lock18+9+5+
@nestjs-redis/schedule18+9+5+
@nestjs-redis/throttler-storage18+9+5+
@nestjs-redis/health-indicator18+9+5+
@nestjs-redis/socket.io-adapter18+9+5+
@nestjs-redis/streams-transporter18+9+5+

All packages support NestJS 9.x, 10.x, and 11.x.

Why use this toolkit?

  • Unified, NestJS-first Redis experience across multiple use cases (client, microservices transport, 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

Background

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)

Contributing

Contributions are welcome! Please read the contributing guide in the repository and open issues/PRs with clear context and reproduction steps.

License

MIT © CSenshi

<div align="center">

⭐ Star this repo🐛 Report Bug💡 Request Feature

</div>

Contributors

Showing top 2 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from CSenshi/nestjs-redis via the GitHub API.Last fetched: 6/29/2026