{"id":46534,"library":"strapi-plugin-redis","title":"Strapi Redis Plugin","description":"Community-maintained plugin for centralized Redis connection management in Strapi v4. Version 1.1.0 (August 2022) wraps ioredis to support single nodes and sentinel replicas. Unlike ad-hoc Redis clients, it provides a global connection pool accessible via Strapi's plugin API. Alpha stage: not officially supported by Strapi, limited documentation, no Sharding examples, and infrequent releases.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/strapi-community/strapi-plugin-redis#readme","tags":["javascript"],"install":[{"cmd":"npm install strapi-plugin-redis","lang":"bash","label":"npm"},{"cmd":"yarn add strapi-plugin-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add strapi-plugin-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Redis client library used for all connections","package":"ioredis","optional":false},{"reason":"Requires Strapi v4.x runtime - not compatible with Strapi v3","package":"strapi","optional":false}],"imports":[{"note":"Plugin is loaded via Strapi's plugin system, not imported directly. Use strapi.plugin('redis') in lifecycle methods or services.","wrong":"import redis from 'strapi-plugin-redis'","symbol":"strapi-plugin-redis","correct":"module.exports = async ({ strapi }) => { const redis = strapi.plugin('redis'); }"},{"note":"TypeScript type for configuration, available from the server config module. Not exported from main entry.","wrong":null,"symbol":"RedisConfig","correct":"import type { RedisConfig } from 'strapi-plugin-redis/server/config'"},{"note":"Config must export a function that returns an object with a 'default' key. Configuration is read from ./config/plugins.js in Strapi.","wrong":"export default { host: 'localhost' }","symbol":"config default export","correct":"export default ({ env }) => ({ default: { connection: { host: env('REDIS_HOST'), port: env('REDIS_PORT') } } })"}],"quickstart":{"code":"// ./config/plugins.js\nmodule.exports = ({ env }) => ({\n  redis: {\n    enabled: true,\n    config: {\n      default: {\n        connection: {\n          host: env('REDIS_HOST', '127.0.0.1'),\n          port: env.int('REDIS_PORT', 6379),\n          db: env.int('REDIS_DB', 0),\n          password: env('REDIS_PASSWORD', '')\n        }\n      }\n    }\n  }\n});\n\n// ./src/index.js (or lifecycle method)\nmodule.exports = {\n  async bootstrap({ strapi }) {\n    const redis = strapi.plugin('redis');\n    const client = redis.connections.default.client;\n    await client.set('test', 'Hello Strapi Redis!');\n    const value = await client.get('test');\n    console.log('Redis value:', value);\n  }\n};","lang":"javascript","description":"Enables the plugin in Strapi config and uses the default Redis connection in a bootstrap lifecycle."},"warnings":[{"fix":"Upgrade your Strapi project to v4 or use an alternative Redis connector for Strapi v3.","message":"Strapi v3 is not supported. Only Strapi v4.0.x and above.","severity":"breaking","affected_versions":"<= 4.0"},{"fix":"Wrap your config object in a function: module.exports = ({ env }) => ({ redis: { enabled: true, config: { default: { ... } } } })","message":"The plugin's config format changed after early alpha. Ensure config is a function returning nested object with 'default' key.","severity":"deprecated","affected_versions":"< 1.0"},{"fix":"If you need cluster support, consider using ioredis directly with a custom connection configuration.","message":"Plugin does not support cluster mode natively; assumed working but no configuration samples provided.","severity":"gotcha","affected_versions":"<= 1.1.0"},{"fix":"Pin the plugin version in package.json and test after upgrades.","message":"The 'connections' property is not documented and may change without notice. Use at your own risk.","severity":"gotcha","affected_versions":"<= 1.1.0"},{"fix":"Use correct sentinel config: { sentinels: [{ host: 'sentinel1', port: 26379 }], name: 'mymaster' }","message":"Sentinel configuration requires 'sentinels' array with 'host' and 'port' per node, not a single host string.","severity":"breaking","affected_versions":"<= 1.1.0"}],"env_vars":null,"search_vec":"'1.1.0':17 '2022':19 'access':41 'ad':31 'ad-hoc':30 'alpha':47 'api':46 'august':18 'central':9 'client':34 'communiti':5 'community-maintain':4 'connect':11,39 'document':55 'exampl':58 'global':38 'hoc':32 'infrequ':60 'ioredi':21 'javascript':62 'limit':54 'maintain':6 'manag':12 'node':25 'offici':50 'plugin':3,7,45 'pool':40 'provid':36 'redi':2,10,33 'releas':61 'replica':28 'sentinel':27 'shard':57 'singl':24 'stage':48 'strapi':1,14,43,53 'support':23,51 'unlik':29 'v4':15 'version':16 'via':42 'wrap':20","created_at":"2026-06-07T13:00:24.100561+00:00","updated_at":"2026-06-07T13:00:24.100561+00:00","problems":[{"fix":"Access strapi.plugin inside a lifecycle method like 'bootstrap' or 'register'.","cause":"Using strapi.plugin before Strapi is fully initialized (e.g., in a module's top-level scope).","error":"TypeError: strapi.plugin is not a function"},{"fix":"Ensure Redis is running: redis-server. Check config: host/port, and that password is correct if set.","cause":"Redis server is not running or host/port misconfigured.","error":"Redis connection refused - connect ECONNREFUSED 127.0.0.1:6379"},{"fix":"Run 'npm install strapi-plugin-redis' and add 'redis: { enabled: true }' to config/plugins.js.","cause":"Plugin not installed or not enabled in config/plugins.js.","error":"Error: The plugin 'redis' is not found. Make sure it is installed and enabled."},{"fix":"Install ioredis: npm install ioredis","cause":"Missing peer dependency ioredis.","error":"Cannot find module 'ioredis'"}],"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/strapi-community/strapi-plugin-redis#readme","github":"https://github.com/strapi-community/strapi-plugin-redis#readme","docs":null,"changelog":null,"pypi":null,"npm":"strapi-plugin-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"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}}