{"id":46614,"library":"thorin-store-redis","title":"Thorin.js Redis Store","description":"Thorin-store-redis is the official Redis store adapter for the Thorin.js framework (v2.1.0). It provides session caching, background job queues, and pub/sub messaging integration. The package is maintained as part of the Thorin.js monorepo with monthly releases. Key differentiators include seamless integration with Thorin's async middleware and built-in connection pooling for high-throughput workloads.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/Thorinjs/Thorin-store-redis","tags":["javascript"],"install":[{"cmd":"npm install thorin-store-redis","lang":"bash","label":"npm"},{"cmd":"yarn add thorin-store-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add thorin-store-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core framework required for store lifecycle and dependency injection","package":"thorin","optional":false},{"reason":"Redis client library used under the hood for connection and commands","package":"ioredis","optional":false}],"imports":[{"note":"Thorin.js is ESM-only since v2; CommonJS require will fail with ERR_REQUIRE_ESM","wrong":"const thorin = require('thorin')","symbol":"thorin","correct":"import thorin from 'thorin'"},{"note":"This package exports a named export, not a default export.","wrong":"import storeRedis from 'thorin-store-redis'","symbol":"storeRedis","correct":"import { storeRedis } from 'thorin-store-redis'"},{"note":"TypeScript users prefer the class for type annotations; available as a named export.","wrong":null,"symbol":"RedisStore","correct":"import { RedisStore } from 'thorin-store-redis'"}],"quickstart":{"code":"import thorin from 'thorin';\nimport { storeRedis } from 'thorin-store-redis';\n\nthorin.store('redis', {\n  host: process.env.REDIS_HOST ?? 'localhost',\n  port: parseInt(process.env.REDIS_PORT ?? '6379'),\n  password: process.env.REDIS_PASSWORD ?? ''\n});\n\nconst store = thorin.store('redis');\nawait store.set('session:123', { userId: 456 }, { ttl: 3600 });\nconst data = await store.get('session:123');\nconsole.log(data); // { userId: 456 }","lang":"typescript","description":"Configures and uses the Redis store for session caching with async get/set operations."},"warnings":[{"fix":"Upgrade to Node.js 16+ and ensure your Redis commands are ioredis-compatible (e.g., no callbacks, use promises).","message":"v2.0 dropped support for Node.js < 16 and replaced redis package with ioredis","severity":"breaking","affected_versions":">=2.0 <2.0"},{"fix":"Change to import { storeRedis } from 'thorin-store-redis'.","message":"The old require('thorin-store-redis').default pattern is deprecated; use named import { storeRedis } instead.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Do not rely on prototype methods on retrieved objects; always treat as plain data.","message":"store.set() automatically serializes objects with JSON.stringify; retrieving with store.get() returns a plain object, not a class instance.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Add a retryStrategy in the config or listen to the 'error' event on the store instance.","message":"Connection errors are not retried by default; implement custom retry logic or use thorin's built-in store error handler.","severity":"gotcha","affected_versions":">=2.0"}],"env_vars":null,"search_vec":"'adapt':13 'async':51 'background':23 'built':55 'built-in':54 'cach':22 'connect':57 'differenti':44 'framework':17 'high':61 'high-throughput':60 'includ':45 'integr':29,47 'javascript':64 'job':24 'key':43 'maintain':33 'messag':28 'middlewar':52 'monorepo':39 'month':41 'offici':10 'packag':31 'part':35 'pool':58 'provid':20 'pub/sub':27 'queue':25 'redi':2,7,11 'releas':42 'seamless':46 'session':21 'store':3,6,12 'thorin':5,49 'thorin-store-redi':4 'thorin.js':1,16,38 'throughput':62 'v2.1.0':18 'workload':63","created_at":"2026-06-07T13:00:47.561336+00:00","updated_at":"2026-06-07T13:00:47.561336+00:00","problems":[{"fix":"Run npm install thorin-store-redis and ensure import is { storeRedis } from 'thorin-store-redis'.","cause":"Package not installed or incorrect import path","error":"Error: Cannot find module 'thorin-store-redis'"},{"fix":"Call thorin.store('redis', config) before attempting to use the store instance.","cause":"The store was not initialized correctly (missing thorin.store call)","error":"TypeError: store.get is not a function"},{"fix":"Start Redis server or check environment variables REDIS_HOST and REDIS_PORT.","cause":"Redis server not running or wrong host/port","error":"Redis connection refused (ECONNREFUSED)"},{"fix":"Ensure the key was set with store.set (string type) and not via raw Redis commands.","cause":"Attempting to use a Redis command on a key of a different type (e.g., store.get on a list)","error":"Error: ReplyError: WRONGTYPE Operation against a key holding the wrong kind of value"}],"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":"http://thorinjs.com","github":"https://github.com/Thorinjs/Thorin-store-redis","docs":null,"changelog":null,"pypi":null,"npm":"thorin-store-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"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}}