{"_id":"@abdokouta/react-redis","_rev":"6-d5b873fd735f35863ceafea9a9f716a0","name":"@abdokouta/react-redis","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@abdokouta/react-redis","version":"1.0.0","keywords":["react","redis","upstash","cache","client-side","browser"],"author":{"name":"Pixielity"},"license":"MIT","_id":"@abdokouta/react-redis@1.0.0","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/pixielity-inc/react-redis#readme","bugs":{"url":"https://github.com/pixielity-inc/react-redis/issues"},"dist":{"shasum":"0d2a7eb03c6c0e1b29d90c4aa62467482f357c25","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.0.0.tgz","fileCount":41,"integrity":"sha512-bPj14E3qeSJK6e7kbyRGOJNrvl4tckHLCIWCYn88K/JNRVOBAmi0iXZuqd/7tpowY8Xx+uS/ZKoM8YyvYQu7JQ==","signatures":[{"sig":"MEQCIEfTcGrNDdDMN/FbTdYjlEe8qDXu4vfI9mZhR8JsPbYxAiBgyJhRklvKFnH0yCEMokiJq60UMykfGWI0I5uBez5Uxw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353834},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"fc68f3855a38af274b0bd187cc08fee46b157961","scripts":{"dev":"tsup --watch","test":"vitest --run","build":"tsup","format":"prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"","test:ui":"vitest --ui","test:watch":"vitest","test:coverage":"vitest --run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"repository":{"url":"git+https://github.com/pixielity-inc/react-redis.git","type":"git"},"_npmVersion":"10.9.4","description":"Client-side Redis connection management using Upstash HTTP API for React","directories":{},"_nodeVersion":"22.22.1","dependencies":{"tslib":"^2.8.1","@upstash/redis":"^1.37.0","@abdokouta/react-di":"^2.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@nesvel/tsup-config":"^1.0.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/react-redis_1.0.0_1774937615308_0.2040678630310031","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@abdokouta/react-redis","version":"1.0.1","keywords":["react","redis","upstash","cache","client-side","browser"],"author":{"name":"Pixielity"},"license":"MIT","_id":"@abdokouta/react-redis@1.0.1","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/pixielity-inc/react-redis#readme","bugs":{"url":"https://github.com/pixielity-inc/react-redis/issues"},"dist":{"shasum":"01dc67b1dc3efee99af6d94ea258417c0acf679c","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.0.1.tgz","fileCount":43,"integrity":"sha512-PUvcyU7+25hiX/PY5Aczi4hQSFM8g6N1Gb3KWBYLfS1ac25GSboOuJElS7+nt6t4b2fafz0ejsfUcy9uy3FP3Q==","signatures":[{"sig":"MEQCIAZAvRJIsFnyQb9BKZCYAzRthgET0JwFDCt3GC1NYrU4AiB/9K3uuChP2pMNzcbfmJOBND5nyu5tsFWDbDGItIlbhQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":358854},"main":"dist/index.js","_from":"file:abdokouta-react-redis-1.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","scripts":{"dev":"tsup --watch","test":"vitest --run","build":"tsup","format":"prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"","test:ui":"vitest --ui","test:watch":"vitest","test:coverage":"vitest --run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/private/var/folders/7_/q437v6xs4sqf5p4755wbbzvh0000gn/T/37724eb971334fd61ca5cb4fec8b2122/abdokouta-react-redis-1.0.1.tgz","_integrity":"sha512-PUvcyU7+25hiX/PY5Aczi4hQSFM8g6N1Gb3KWBYLfS1ac25GSboOuJElS7+nt6t4b2fafz0ejsfUcy9uy3FP3Q==","repository":{"url":"git+https://github.com/pixielity-inc/react-redis.git","type":"git"},"_npmVersion":"10.9.4","description":"Client-side Redis connection management using Upstash HTTP API for React","directories":{},"_nodeVersion":"22.22.1","dependencies":{"tslib":"^2.8.1","@upstash/redis":"^1.37.0","@abdokouta/react-di":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@nesvel/tsup-config":"^1.0.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-redis_1.0.1_1774943848572_0.25558871908758074","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@abdokouta/react-redis","version":"1.0.3","keywords":["react","redis","upstash","cache","client-side","browser","dependency-injection","di"],"author":{"url":"https://github.com/abdokouta","name":"Abdelrhman Kouta","email":"abdelrhman@pixielity.com"},"license":"MIT","_id":"@abdokouta/react-redis@1.0.3","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/abdokouta/redis#readme","bugs":{"url":"https://github.com/abdokouta/redis/issues"},"dist":{"shasum":"a05274f432953fdcd0e7ebcfa7e7b8c7bcde319a","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.0.3.tgz","fileCount":10,"integrity":"sha512-LrpJHWvzHAVujOqLVsXMHiDBCiFIvM2BHDT84b62dTqAOxN2javtemQz0nek5GQ5RRTYIq346k5wGJi7igLfTQ==","signatures":[{"sig":"MEUCIQD4x329vk0KH72a3LgaoNc+JzY3WuTTYgkY6/Jkd181ygIgemKCadcCDHeoNidB353/tkoGVsE2QQ1ix8oirwT/7xo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242359},"main":"./dist/index.js","type":"module","_from":"file:abdokouta-react-redis-1.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=9.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","test":"vitest run","build":"tsup","clean":"rm -rf dist node_modules/.cache","format":"prettier --write .","release":"pnpm publish --access public --no-git-checks","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/private/var/folders/7_/q437v6xs4sqf5p4755wbbzvh0000gn/T/6cd2d45bc7400636a6c5e8a2ee3e7a26/abdokouta-react-redis-1.0.3.tgz","_integrity":"sha512-LrpJHWvzHAVujOqLVsXMHiDBCiFIvM2BHDT84b62dTqAOxN2javtemQz0nek5GQ5RRTYIq346k5wGJi7igLfTQ==","repository":{"url":"git+https://github.com/abdokouta/redis.git","type":"git","directory":"packages/redis"},"_npmVersion":"11.12.1","description":"Client-side Redis connection management using Upstash HTTP API for React","directories":{},"sideEffects":false,"_nodeVersion":"22.22.1","dependencies":{"tslib":"^2.8.1","@upstash/redis":"^1.37.0","@abdokouta/react-di":"^2.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@nesvel/tsup-config":"^1.0.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-redis_1.0.3_1774953872076_0.8718334437975759","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@abdokouta/react-redis","version":"1.0.4","keywords":["react","redis","upstash","cache","client-side","browser","dependency-injection","di"],"author":{"url":"https://github.com/abdokouta","name":"Abdelrhman Kouta","email":"abdelrhman@pixielity.com"},"license":"MIT","_id":"@abdokouta/react-redis@1.0.4","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/abdokouta/redis#readme","bugs":{"url":"https://github.com/abdokouta/redis/issues"},"dist":{"shasum":"ae84120de013494601840d52624e563a5a4a28bf","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.0.4.tgz","fileCount":9,"integrity":"sha512-qxfz6Uw2jneYsNxK4/3vol0x3TK5QeCpg9jOeLdr/Wrk83WZdVng4O5vfIycCqMnJUIa8TofXxMH5JY8+3TX9A==","signatures":[{"sig":"MEQCIAlU6Z6O3DttGyJhANFmHHacRFR0P4fev+e3QUARoCtZAiAHKkuc75HI1Hi5zBq9Sr+H6BH5u5uKrHvO7BkavQruDg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":245338},"main":"./dist/index.js","type":"module","_from":"file:abdokouta-react-redis-1.0.4.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=9.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","test":"vitest run","build":"tsup","clean":"rm -rf dist node_modules/.cache","format":"prettier --write .","release":"pnpm publish --access public --no-git-checks","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/tmp/19bdcece4f8647e65be7b1a4fb71b2f1/abdokouta-react-redis-1.0.4.tgz","_integrity":"sha512-qxfz6Uw2jneYsNxK4/3vol0x3TK5QeCpg9jOeLdr/Wrk83WZdVng4O5vfIycCqMnJUIa8TofXxMH5JY8+3TX9A==","repository":{"url":"git+https://github.com/abdokouta/redis.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.9.7","description":"Client-side Redis connection management using Upstash HTTP API for React","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"tslib":"^2.8.1","@upstash/redis":"^1.37.0","@abdokouta/react-di":"^2.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","jsdom":"^29.0.1","vitest":"^4.1.2","prettier":"^3.8.1","@eslint/js":"10.0.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","typescript-eslint":"^8.58.0","@nesvel/tsup-config":"^1.0.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-redis_1.0.4_1775358945867_0.7537208834909714","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@abdokouta/react-redis","version":"1.1.2","keywords":["react","redis","upstash","cache","client-side","browser","dependency-injection","di"],"author":{"url":"https://github.com/abdokouta","name":"Abdelrhman Kouta","email":"abdelrhman@pixielity.com"},"license":"MIT","_id":"@abdokouta/react-redis@1.1.2","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/abdokouta/react-redis#readme","bugs":{"url":"https://github.com/abdokouta/react-redis/issues"},"dist":{"shasum":"d980e46100b5216bcc28ff3a3a7204fe6e0befa9","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.1.2.tgz","fileCount":10,"integrity":"sha512-mrQZfKxYcYTJvkiiUB629anELRA7Tv5C0Tz+B1LQPELmqc6Ns7p2H8zeCYUBiVhG28yhBjOoBo99mqHZ9PtPlQ==","signatures":[{"sig":"MEYCIQC+U3F1jeLT8qXa6Y6VXkQHTTMi/XBGWWiP70gbsXYlNwIhAOrM8ZoB/tjQy4KTqv5SGB2mhrmQg672koW/4ZRzCCK9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":210408},"main":"./dist/index.js","type":"module","_from":"file:abdokouta-react-redis-1.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=9.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","test":"vitest run","build":"tsup","clean":"rm -rf dist node_modules/.cache","format":"prettier --write .","release":"pnpm publish --access public --no-git-checks","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/tmp/d0982ef700dde00f1bdd5ccc26a0c69d/abdokouta-react-redis-1.1.2.tgz","_integrity":"sha512-mrQZfKxYcYTJvkiiUB629anELRA7Tv5C0Tz+B1LQPELmqc6Ns7p2H8zeCYUBiVhG28yhBjOoBo99mqHZ9PtPlQ==","repository":{"url":"git+https://github.com/abdokouta/react-redis.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.9.7","description":"Client-side Redis connection management using Upstash HTTP API for React","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"@upstash/redis":"^1.37.0","@abdokouta/ts-container":"^1.2.0","@abdokouta/react-support":"^2.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","jsdom":"^29.0.1","vitest":"^4.1.2","prettier":"^3.8.1","@eslint/js":"10.0.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","typescript-eslint":"^8.58.0","@nesvel/tsup-config":"^1.0.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","@abdokouta/ts-container-react":"^1.2.0"},"peerDependenciesMeta":{"react":{"optional":true},"@abdokouta/ts-container-react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-redis_1.1.2_1775423311474_0.8457899248960674","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@abdokouta/react-redis","version":"1.1.3","description":"Client-side Redis connection management using Upstash HTTP API for React","license":"MIT","author":{"name":"Abdelrhman Kouta","email":"abdelrhman@pixielity.com","url":"https://github.com/abdokouta"},"repository":{"type":"git","url":"git+https://github.com/abdokouta/react-redis.git","directory":"packages/redis"},"bugs":{"url":"https://github.com/abdokouta/react-redis/issues"},"homepage":"https://github.com/abdokouta/react-redis#readme","keywords":["react","redis","upstash","cache","client-side","browser","dependency-injection","di"],"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","dependencies":{"@upstash/redis":"^1.37.0"},"peerDependencies":{"@abdokouta/ts-container":"^1.2.0","@abdokouta/react-support":"^2.1.0","@abdokouta/ts-container-react":"^1.2.0","react":"^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"@abdokouta/ts-container":{"optional":false},"@abdokouta/react-support":{"optional":false},"@abdokouta/ts-container-react":{"optional":true},"react":{"optional":true}},"devDependencies":{"@eslint/js":"10.0.1","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/tsup-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4","@vitest/ui":"^4.1.2","jsdom":"^29.0.1","prettier":"^3.8.1","tsup":"^8.5.1","typescript":"^6.0.2","typescript-eslint":"^8.58.0","vitest":"^4.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"engines":{"node":">=18.0.0","pnpm":">=9.0.0"},"sideEffects":false,"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist node_modules/.cache","typecheck":"tsc --noEmit","lint":"eslint . --max-warnings 0","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","release":"pnpm publish --access public --no-git-checks"},"_id":"@abdokouta/react-redis@1.1.3","_integrity":"sha512-fxS8kJ3VPZNxEsPt9dD32NGXmVkRl7B5EGggEjfWcZ2eXprhwLb6dnHYYm7tyhZj2wlPQcrZJvDD8XcOyr48Mg==","_resolved":"/private/var/folders/7_/q437v6xs4sqf5p4755wbbzvh0000gn/T/b3b0caa5c999850d2003c09dc8d72786/abdokouta-react-redis-1.1.3.tgz","_from":"file:abdokouta-react-redis-1.1.3.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-fxS8kJ3VPZNxEsPt9dD32NGXmVkRl7B5EGggEjfWcZ2eXprhwLb6dnHYYm7tyhZj2wlPQcrZJvDD8XcOyr48Mg==","shasum":"1a29cd48722cee98d6ac4675057791b4826aa430","tarball":"https://registry.npmjs.org/@abdokouta/react-redis/-/react-redis-1.1.3.tgz","fileCount":10,"unpackedSize":210537,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDKF1OlcaEfPfccQXbn6SODxvpFCc0/1nZuZZPUn3gOVwIhAIlXzeMWjeRFjTNjRseyczgUHrxnouShaQbSy6/eLFGI"}]},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"directories":{},"maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-redis_1.1.3_1775461576430_0.13581663603346938"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-31T06:13:35.238Z","modified":"2026-04-06T07:46:16.728Z","1.0.0":"2026-03-31T06:13:35.459Z","1.0.1":"2026-03-31T07:57:28.716Z","1.0.3":"2026-03-31T10:44:32.234Z","1.0.4":"2026-04-05T03:15:46.041Z","1.1.2":"2026-04-05T21:08:31.606Z","1.1.3":"2026-04-06T07:46:16.611Z"},"bugs":{"url":"https://github.com/abdokouta/react-redis/issues"},"author":{"name":"Abdelrhman Kouta","email":"abdelrhman@pixielity.com","url":"https://github.com/abdokouta"},"license":"MIT","homepage":"https://github.com/abdokouta/react-redis#readme","keywords":["react","redis","upstash","cache","client-side","browser","dependency-injection","di"],"repository":{"type":"git","url":"git+https://github.com/abdokouta/react-redis.git","directory":"packages/redis"},"description":"Client-side Redis connection management using Upstash HTTP API for React","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"readme":"# @abdokouta/react-redis\n\nClient-side Redis connection management using Upstash HTTP API for Refine\napplications.\n\n## Features\n\n- ✅ **Browser-Compatible**: Uses Upstash HTTP REST API (no Node.js required)\n- ✅ **Multiple Connections**: Support for named connections (cache, session,\n  etc.)\n- ✅ **Dependency Injection**: Integrates with @abdokouta/container\n- ✅ **React Hooks**: Easy-to-use hooks for React components\n- ✅ **TypeScript**: Full type safety with comprehensive JSDoc\n- ✅ **Production-Ready**: Error handling, retries, and timeouts\n- ✅ **Zero Config**: Sensible defaults with full customization\n\n## Installation\n\n```bash\nnpm install @abdokouta/react-redis @upstash/redis\n# or\nyarn add @abdokouta/react-redis @upstash/redis\n# or\npnpm add @abdokouta/react-redis @upstash/redis\n```\n\n## Quick Start\n\n### 1. Get Upstash Credentials\n\n1. Sign up at [Upstash Console](https://console.upstash.com)\n2. Create a Redis database\n3. Copy the REST URL and token from the \"REST API\" section\n\n### 2. Configure the Module\n\n```typescript\n// app.module.ts\nimport { Module } from '@abdokouta/container';\nimport { RedisModule } from '@abdokouta/react-redis';\n\n@Module({\n  imports: [\n    RedisModule.forRoot({\n      default: 'cache',\n      connections: {\n        cache: {\n          url: process.env.UPSTASH_REDIS_REST_URL!,\n          token: process.env.UPSTASH_REDIS_REST_TOKEN!,\n        },\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### 3. Use in Your Code\n\n#### In Services (with DI)\n\n```typescript\nimport { Injectable } from '@abdokouta/container';\nimport { RedisService } from '@abdokouta/react-redis';\n\n@Injectable()\nexport class UserService {\n  constructor(private readonly redis: RedisService) {}\n\n  async cacheUser(user: User): Promise<void> {\n    const connection = await this.redis.connection();\n    await connection.set(\n      `user:${user.id}`,\n      JSON.stringify(user),\n      { ex: 3600 } // Expire in 1 hour\n    );\n  }\n\n  async getUser(id: string): Promise<User | null> {\n    const connection = await this.redis.connection();\n    const data = await connection.get(`user:${id}`);\n    return data ? JSON.parse(data) : null;\n  }\n}\n```\n\n#### In React Components (with Hooks)\n\n```typescript\nimport { useRedis } from '@abdokouta/react-redis';\nimport { useEffect, useState } from 'react';\n\nfunction UserProfile({ userId }: { userId: string }) {\n  const redis = useRedis();\n  const [user, setUser] = useState<User | null>(null);\n\n  useEffect(() => {\n    async function loadUser() {\n      const connection = await redis.connection();\n\n      // Try cache first\n      const cached = await connection.get(`user:${userId}`);\n      if (cached) {\n        setUser(JSON.parse(cached));\n        return;\n      }\n\n      // Fetch and cache\n      const user = await fetchUser(userId);\n      await connection.set(\n        `user:${userId}`,\n        JSON.stringify(user),\n        { ex: 3600 }\n      );\n      setUser(user);\n    }\n\n    loadUser();\n  }, [userId, redis]);\n\n  return <div>{user?.name}</div>;\n}\n```\n\n## Configuration\n\n### Multiple Connections\n\nConfigure multiple Redis instances for different purposes:\n\n```typescript\nRedisModule.forRoot({\n  default: 'cache',\n  connections: {\n    // Cache connection\n    cache: {\n      url: process.env.UPSTASH_CACHE_URL!,\n      token: process.env.UPSTASH_CACHE_TOKEN!,\n    },\n    // Session connection\n    session: {\n      url: process.env.UPSTASH_SESSION_URL!,\n      token: process.env.UPSTASH_SESSION_TOKEN!,\n      timeout: 10000,\n    },\n    // Rate limiting connection\n    ratelimit: {\n      url: process.env.UPSTASH_RATELIMIT_URL!,\n      token: process.env.UPSTASH_RATELIMIT_TOKEN!,\n      enableAutoPipelining: true,\n    },\n  },\n});\n```\n\n### Connection Options\n\n```typescript\ninterface RedisConnectionConfig {\n  // Required\n  url: string; // Upstash Redis REST URL\n  token: string; // Upstash Redis REST token\n\n  // Optional\n  timeout?: number; // Request timeout in ms (default: 5000)\n\n  retry?: {\n    retries?: number;\n    backoff?: (retryCount: number) => number;\n  };\n\n  enableAutoPipelining?: boolean; // Batch commands automatically\n}\n```\n\n### Retry Configuration\n\n```typescript\n{\n  retry: {\n    retries: 3,\n    backoff: (retryCount) => {\n      // Exponential backoff: 100ms, 200ms, 400ms\n      return Math.min(100 * 2 ** retryCount, 1000);\n    }\n  }\n}\n```\n\n## API Reference\n\n### RedisService\n\nMain service for connection management.\n\n#### Methods\n\n- `connection(name?: string): Promise<RedisConnection>` - Get a connection\n- `disconnect(name?: string): Promise<void>` - Disconnect a connection\n- `disconnectAll(): Promise<void>` - Disconnect all connections\n- `getConnectionNames(): string[]` - Get configured connection names\n- `getDefaultConnectionName(): string` - Get default connection name\n- `isConnectionActive(name?: string): boolean` - Check if connection is active\n\n### RedisConnection\n\nInterface for Redis operations.\n\n#### Basic Operations\n\n```typescript\n// Get/Set\nawait connection.get('key');\nawait connection.set('key', 'value', { ex: 3600 });\n\n// Delete\nawait connection.del('key1', 'key2');\n\n// Exists\nawait connection.exists('key1', 'key2');\n\n// Expiration\nawait connection.expire('key', 300);\nawait connection.ttl('key');\n```\n\n#### Multi-Key Operations\n\n```typescript\n// Get multiple keys\nconst [val1, val2] = await connection.mget('key1', 'key2');\n\n// Set multiple keys\nawait connection.mset({\n  key1: 'value1',\n  key2: 'value2',\n});\n```\n\n#### Increment/Decrement\n\n```typescript\n// Increment\nawait connection.incr('counter');\nawait connection.incrby('counter', 5);\n\n// Decrement\nawait connection.decr('counter');\nawait connection.decrby('counter', 3);\n```\n\n#### Pipeline (Batching)\n\n```typescript\nconst results = await connection\n  .pipeline()\n  .set('key1', 'value1')\n  .set('key2', 'value2')\n  .get('key1')\n  .del('key3')\n  .exec();\n\nconsole.log(results); // ['OK', 'OK', 'value1', 1]\n```\n\n#### Sorted Sets (for advanced use)\n\n```typescript\n// Add to sorted set\nawait connection.zadd('leaderboard', 100, 'user:1');\n\n// Get range\nconst top10 = await connection.zrange('leaderboard', 0, 9);\n\n// Remove by score\nawait connection.zremrangebyscore('leaderboard', 0, 50);\n```\n\n### React Hooks\n\n#### useRedis()\n\nGet the Redis service instance.\n\n```typescript\nconst redis = useRedis();\nconst connection = await redis.connection('cache');\n```\n\n#### useRedisConnection(name?)\n\nGet a specific connection (returns a Promise).\n\n```typescript\nconst getConnection = useRedisConnection('cache');\n\nuseEffect(() => {\n  getConnection.then(async (connection) => {\n    await connection.set('key', 'value');\n  });\n}, [getConnection]);\n```\n\n## Common Patterns\n\n### Cache-Aside Pattern\n\n```typescript\nasync function getUser(id: string): Promise<User> {\n  const connection = await redis.connection();\n\n  // Try cache\n  const cached = await connection.get(`user:${id}`);\n  if (cached) {\n    return JSON.parse(cached);\n  }\n\n  // Fetch from database\n  const user = await db.users.findById(id);\n\n  // Cache for 1 hour\n  await connection.set(`user:${id}`, JSON.stringify(user), { ex: 3600 });\n\n  return user;\n}\n```\n\n### Distributed Locking\n\n```typescript\nasync function acquireLock(\n  resource: string,\n  ttl: number = 10\n): Promise<boolean> {\n  const connection = await redis.connection();\n  const lockKey = `lock:${resource}`;\n\n  // Try to acquire lock (set if not exists)\n  const acquired = await connection.set(lockKey, 'locked', {\n    nx: true,\n    ex: ttl,\n  });\n\n  return acquired === 'OK';\n}\n\nasync function releaseLock(resource: string): Promise<void> {\n  const connection = await redis.connection();\n  await connection.del(`lock:${resource}`);\n}\n```\n\n### Rate Limiting\n\n```typescript\nasync function checkRateLimit(\n  userId: string,\n  limit: number = 100,\n  window: number = 60\n): Promise<boolean> {\n  const connection = await redis.connection();\n  const key = `ratelimit:${userId}`;\n\n  const current = await connection.incr(key);\n\n  if (current === 1) {\n    // First request, set expiration\n    await connection.expire(key, window);\n  }\n\n  return current <= limit;\n}\n```\n\n### Session Storage\n\n```typescript\nasync function saveSession(\n  sessionId: string,\n  data: SessionData\n): Promise<void> {\n  const connection = await redis.connection('session');\n  await connection.set(\n    `session:${sessionId}`,\n    JSON.stringify(data),\n    { ex: 86400 } // 24 hours\n  );\n}\n\nasync function getSession(sessionId: string): Promise<SessionData | null> {\n  const connection = await redis.connection('session');\n  const data = await connection.get(`session:${sessionId}`);\n  return data ? JSON.parse(data) : null;\n}\n```\n\n## Best Practices\n\n### 1. Use Appropriate TTLs\n\nAlways set expiration times to prevent memory leaks:\n\n```typescript\n// Good\nawait connection.set('temp:data', value, { ex: 300 });\n\n// Bad (no expiration)\nawait connection.set('temp:data', value);\n```\n\n### 2. Use Pipelines for Multiple Operations\n\nBatch operations for better performance:\n\n```typescript\n// Good\nawait connection\n  .pipeline()\n  .set('key1', 'value1')\n  .set('key2', 'value2')\n  .set('key3', 'value3')\n  .exec();\n\n// Bad (3 HTTP requests)\nawait connection.set('key1', 'value1');\nawait connection.set('key2', 'value2');\nawait connection.set('key3', 'value3');\n```\n\n### 3. Handle Errors Gracefully\n\n```typescript\ntry {\n  const connection = await redis.connection();\n  await connection.set('key', 'value');\n} catch (error) {\n  console.error('Redis error:', error);\n  // Fall back to database or return cached data\n}\n```\n\n### 4. Use Namespaced Keys\n\nOrganize keys with prefixes:\n\n```typescript\n// Good\n`user:${userId}:profile``cache:posts:${postId}``session:${sessionId}`\n// Bad\n`${userId}``${postId}`;\n```\n\n### 5. Clean Up on Shutdown\n\n```typescript\n// In your app shutdown handler\nawait redis.disconnectAll();\n```\n\n## TypeScript Support\n\nFull TypeScript support with comprehensive types:\n\n```typescript\nimport type {\n  RedisConnection,\n  RedisConfig,\n  RedisConnectionConfig,\n  SetOptions,\n  RedisPipeline,\n} from '@abdokouta/react-redis';\n```\n\n## Browser Compatibility\n\nThis package works in all modern browsers that support:\n\n- Fetch API\n- Promises\n- ES2020 features\n\nNo polyfills required for modern browsers (Chrome 80+, Firefox 75+, Safari\n13.1+, Edge 80+).\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines before\nsubmitting PRs.\n\n## Support\n\n- [Documentation](https://refine.dev/docs)\n- [Discord](https://discord.gg/refine)\n- [GitHub Issues](https://github.com/refinedev/refine/issues)\n\n## Related Packages\n\n- [@abdokouta/cache](../cache) - Multi-driver cache system\n- [@upstash/redis](https://github.com/upstash/upstash-redis) - Upstash Redis\n  client\n","readmeFilename":"README.md"}