{"id":46158,"library":"redis-sentinel-client","title":"redis-sentinel-client","description":"A transparent Redis Sentinel client for Node.js that acts as a drop-in replacement for node_redis RedisClient. It automatically connects to Redis Sentinel, discovers the current master, and handles failover by reconnecting to the new master. The current stable version is 0.2.5. This package is unmaintained and depends on a specific fork of node_redis. It is suitable for legacy projects that need automatic Redis Sentinel failover without manual reconnection logic.","status":"deprecated","version":"0.2.5","language":"javascript","source_language":"en","source_url":"https://github.com/DocuSignDev/node-redis-sentinel-client","tags":["javascript","redis","redis-sentinel"],"install":[{"cmd":"npm install redis-sentinel-client","lang":"bash","label":"npm"},{"cmd":"yarn add redis-sentinel-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-sentinel-client","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Depends on a specific fork of node_redis (DocuSignDev fork) which has been modified for Sentinel support.","package":"redis","optional":false}],"imports":[{"note":"This package uses CommonJS (require). There is no ESM default import.","wrong":"import RedisSentinel from 'redis-sentinel-client';","symbol":"RedisSentinel","correct":"const RedisSentinel = require('redis-sentinel-client');"},{"note":"The createClient function accepts (port, host, options) but this is less common and may be confused with node_redis's createClient. Prefer the options object form.","wrong":"const sentinelClient = RedisSentinel.createClient(6379, 'localhost', options);","symbol":"createClient","correct":"const sentinelClient = RedisSentinel.createClient(options);"},{"note":"All Redis commands are proxied to the master client. send_command is available but not recommended.","wrong":"sentinelClient.send_command('SET', ['key', 'value']);","symbol":"sentinelClient","correct":"sentinelClient.set('key', 'value');"}],"quickstart":{"code":"const RedisSentinel = require('redis-sentinel-client');\n\nconst options = {\n  sentinels: [\n    ['127.0.0.1', 26379],\n    ['127.0.0.1', 26380]\n  ],\n  masterName: 'mymaster',\n  masterOptions: {\n    auth_pass: process.env.REDIS_PASSWORD || ''\n  }\n};\n\nconst sentinelClient = RedisSentinel.createClient(options);\n\nsentinelClient.on('connect', () => {\n  console.log('Connected to Redis master via sentinel');\n});\n\nsentinelClient.on('error', (err) => {\n  console.error('Redis error:', err);\n});\n\nsentinelClient.set('testkey', 'Hello Sentinel', (err, reply) => {\n  if (err) {\n    console.error('Set error:', err);\n  } else {\n    console.log('Set succeeded:', reply);\n    sentinelClient.get('testkey', (err, value) => {\n      console.log('Got value:', value);\n      sentinelClient.quit();\n    });\n  }\n});","lang":"javascript","description":"Creates a sentinel client that connects to a list of sentinels and communicates with the Redis master, handles failover transparently, and performs a set/get operation."},"warnings":[{"fix":"Use a more modern alternative like ioredis which has built-in Sentinel support (new Redis({sentinels: [...], name: 'mymaster'})) or redis npm package v4+ with Sentinel support.","message":"This package depends on a specific fork of node_redis (DocuSignDev/node-redis). That fork is no longer maintained, and the package has not been updated to work with the official redis npm package v3+.","severity":"deprecated","affected_versions":"*"},{"fix":"Always set master_auth_pass if your Redis master requires authentication. Monitor 'switch-master' event to re-establish connections if needed.","message":"The sentinel client emits a 'switch-master' event when a failover occurs, but the client does not automatically reconnect using authentication credentials if master_auth_pass is not set. Data loss can occur during failover.","severity":"gotcha","affected_versions":"*"},{"fix":"Use ioredis for cluster support or manage multiple sentinel clients manually.","message":"The package only supports a single master (with optional authentication). It does not support Redis Cluster or multiple masters.","severity":"gotcha","affected_versions":"*"},{"fix":"Migrate to redis npm package v4+ with its Sentinel support (require('redis').createClient({ url: 'redis://user:pass@host:port' })) or ioredis.","message":"The node_redis package (and its fork) are considered legacy. The official redis npm package has rewritten the client (v4+), and redis-sentinel-client does not work with it.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"search_vec":"'0.2.5':48 'act':13 'automat':25,70 'client':4,9 'connect':26 'current':32,44 'depend':54 'discov':30 'drop':17 'drop-in':16 'failov':36,73 'fork':58 'handl':35 'javascript':78 'legaci':66 'logic':77 'manual':75 'master':33,42 'need':69 'new':41 'node':21,60 'node.js':11 'packag':50 'project':67 'reconnect':38,76 'redi':2,7,22,28,61,71,79,81 'redis-sentinel':80 'redis-sentinel-cli':1 'rediscli':23 'replac':19 'sentinel':3,8,29,72,82 'specif':57 'stabl':45 'suitabl':64 'transpar':6 'unmaintain':52 'version':46 'without':74","created_at":"2026-06-07T12:58:34.695824+00:00","updated_at":"2026-06-07T12:58:34.695824+00:00","problems":[{"fix":"Verify sentinel is running and monitoring the correct master name. Check masterOptions for correct host/port.","cause":"The sentinel client could not connect to the master because the master is down or the sentinel list is incorrect.","error":"Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED"},{"fix":"Add master_auth_pass: 'yourpassword' to the options object.","cause":"Master requires authentication but master_auth_pass was not provided in options.","error":"Error: NOAUTH Authentication required."},{"fix":"Ensure you are using require('redis-sentinel-client') and the module is installed.","cause":"Usually caused by incorrect require path or importing as ES module when the package uses CommonJS.","error":"TypeError: RedisSentinel.createClient is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/DocuSignDev/node-redis-sentinel-client","github":"https://github.com/DocuSignDev/node-redis-sentinel-client","docs":null,"changelog":null,"pypi":null,"npm":"redis-sentinel-client","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}