{"id":13487561,"url":"https://github.com/eggjs/session-redis","last_synced_at":"2025-03-27T22:31:31.106Z","repository":{"id":57220735,"uuid":"83503835","full_name":"eggjs/egg-session-redis","owner":"eggjs","description":"redis store for egg session","archived":false,"fork":false,"pushed_at":"2018-09-10T04:32:28.000Z","size":13,"stargazers_count":44,"open_issues_count":0,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T21:05:54.574Z","etag":null,"topics":["egg","egg-plugin","redis","session"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-01T02:48:20.000Z","updated_at":"2024-03-22T12:12:39.000Z","dependencies_parsed_at":"2022-08-29T04:01:39.869Z","dependency_job_id":null,"html_url":"https://github.com/eggjs/egg-session-redis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-session-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-session-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-session-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-session-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/egg-session-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222322034,"owners_count":16966433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg","egg-plugin","redis","session"],"created_at":"2024-07-31T18:01:00.628Z","updated_at":"2025-03-27T22:31:31.087Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","readme":"# @eggjs/session-redis\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/eggjs/session-redis/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/session-redis/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/@eggjs/session-redis.svg?style=flat)](https://nodejs.org/en/download/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/eggjs/session-redis)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/session-redis.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/session-redis\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/session-redis.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/session-redis?branch=master\n[snyk-image]: https://snyk.io/test/npm/@eggjs/session-redis/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/session-redis\n[download-image]: https://img.shields.io/npm/dm/@eggjs/session-redis.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/session-redis\n\nA session extension for store session in redis.\n\n## Install\n\n```bash\nnpm i @eggjs/session-redis @eggjs/redis\n```\n\n## Usage\n\nThis module dependent on [@eggjs/redis](https://github.com/eggjs/redis) plugin, so we must enable both.\n\n```js\n// {app_root}/config/plugin.js\nexports.sessionRedis = {\n  enable: true,\n  package: '@eggjs/session-redis',\n};\n\nexports.redis = {\n  enable: true,\n  package: '@eggjs/redis',\n};\n```\n\n## Configuration\n\nIf we only have one redis instance:\n\n```js\n// {app_root}/config/config.default.js\nexports.redis = {\n  client: {\n    host: 'your redis host',\n    port: 'your redis port',\n    password: '',\n    db: '0',\n  },\n  agent:true\n};\n// no need to set any sessionRedis config\n```\n\nIf we have more than one redis instance, we need to configure which instance to be used as session store.\n\n```js\n// {app_root}/config/config.default.js\n\nexports.redis = {\n  clients: {\n    session: { /* config */ },\n    cache: { /* config */ },\n  },\n};\n\nexports.sessionRedis = {\n  name: 'session', // specific instance `session` as the session store\n};\n```\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=eggjs/session-redis)](https://github.com/eggjs/session-redis/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","funding_links":[],"categories":["仓库","Plugins"],"sub_categories":["插件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fsession-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fsession-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fsession-redis/lists"}