{"id":13485211,"url":"https://github.com/tj/connect-redis","last_synced_at":"2026-10-19T07:21:26.544Z","repository":{"id":973397,"uuid":"771088","full_name":"tj/connect-redis","owner":"tj","description":"Redis session store for Connect","archived":false,"fork":false,"pushed_at":"2026-09-10T04:50:47.000Z","size":433,"stargazers_count":2820,"open_issues_count":0,"forks_count":345,"subscribers_count":52,"default_branch":"master","last_synced_at":"2026-10-17T07:40:03.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"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/tj.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2010-07-12T19:47:08.000Z","updated_at":"2026-10-13T18:51:23.000Z","dependencies_parsed_at":"2026-09-16T19:54:52.624Z","dependency_job_id":null,"html_url":"https://github.com/tj/connect-redis","commit_stats":{"total_commits":289,"total_committers":66,"mean_commits":4.378787878787879,"dds":0.6678200692041523,"last_synced_commit":"f390403456b1b35a6dca74b1c144f6deeca840cd"},"previous_names":["visionmedia/connect-redis"],"tags_count":74,"template":false,"template_full_name":null,"purl":"pkg:github/tj/connect-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fconnect-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fconnect-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fconnect-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fconnect-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tj","download_url":"https://codeload.github.com/tj/connect-redis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fconnect-redis/sbom","scorecard":{"id":888089,"data":{"date":"2025-08-11","repo":{"name":"github.com/tj/connect-redis","commit":"8d733b35da25f5a14935f9633db7653c74caebe0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":3,"reason":"Found 10/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/tj/connect-redis/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/tj/connect-redis/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/tj/connect-redis/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/tj/connect-redis/stale.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/build.yml:21","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":5,"reason":"3 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/stale.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T10:46:06.959Z","repository_id":973397,"created_at":"2025-08-24T10:46:06.960Z","updated_at":"2025-08-24T10:46:06.960Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38333509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-17T02:00:06.547Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T17:01:51.092Z","updated_at":"2026-10-19T07:21:26.538Z","avatar_url":"https://github.com/tj.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Stale"],"sub_categories":["JS Libraries \u0026 Utilities"],"readme":"[![build](https://github.com/tj/connect-redis/actions/workflows/build.yml/badge.svg)](https://github.com/tj/connect-redis/actions/workflows/build.yml) [![npm](https://img.shields.io/npm/v/connect-redis.svg)](https://npmjs.com/package/connect-redis) ![Downloads](https://img.shields.io/npm/dm/connect-redis.svg)\n\n**connect-redis** provides Redis session storage for Express.\n\n## Installation\n\n**connect-redis** requires `express-session` and [`redis`][1]:\n\n```sh\nnpm install redis connect-redis express-session\n```\n\n**TypeScript note**: types included in the package, don't install `@types/connect-redis`.\n\n## API\n\nFull setup:\n\n```js\nimport {RedisStore} from \"connect-redis\"\nimport session from \"express-session\"\nimport {createClient} from \"redis\"\n\n// Initialize client.\nlet redisClient = createClient()\nredisClient.connect().catch(console.error)\n\n// Initialize store.\nlet redisStore = new RedisStore({\n  client: redisClient,\n  prefix: \"myapp:\",\n})\n\n// Initialize session storage.\napp.use(\n  session({\n    store: redisStore,\n    resave: false, // required: force lightweight session keep alive (touch)\n    saveUninitialized: false, // recommended: only save session when data exists\n    secret: \"keyboard cat\",\n  }),\n)\n```\n\n### RedisStore(options)\n\n#### Options\n\n##### client\n\nAn instance of [`redis`][1]\n\n##### prefix\n\nKey prefix in Redis (default: `sess:`).\n\n**Note**: This prefix appends to whatever prefix you may have set on the `client` itself.\n\n**Note**: You may need unique prefixes for different applications sharing the same Redis instance. This limits bulk commands exposed in `express-session` (like `length`, `all`, `keys`, and `clear`) to a single application's data.\n\n##### ttl\n\nIf the session cookie has a `expires` date, `connect-redis` will use it as the TTL.\n\nOtherwise, it will expire the session using the `ttl` option (default: `86400` seconds or one day).\n\n```ts\ninterface RedisStoreOptions {\n  ...\n  ttl?: number | {(sess: SessionData): number}\n}\n```\n\n`ttl` also has external callback support. You can use it for dynamic TTL generation. It has access to `session` data.\n\n**Note**: The TTL is reset every time a user interacts with the server. You can disable this behavior in _some_ instances by using `disableTouch`.\n\n**Note**: `express-session` does not update `expires` until the end of the request life cycle. _Calling `session.save()` manually beforehand will have the previous value_.\n\n##### disableTouch\n\nDisables resetting the TTL when using `touch` (default: `false`)\n\nThe `express-session` package uses `touch` to signal to the store that the user has interacted with the session but hasn't changed anything in its data. Typically, this helps keep the users session alive if session changes are infrequent but you may want to disable it to cut down the extra calls or to prevent users from keeping sessions open too long. Also consider enabling if you store a lot of data on the session.\n\nRef: \u003chttps://github.com/expressjs/session#storetouchsid-session-callback\u003e\n\n##### disableTTL\n\nDisables key expiration completely (default: `false`)\n\nThis option disables key expiration requiring the user to manually manage key cleanup outside of `connect-redis`. Only use if you know what you are doing and have an exceptional case where you need to manage your own expiration in Redis.\n\n**Note**: This has no effect on `express-session` setting cookie expiration.\n\n##### serializer\n\nProvide a custom encoder/decoder to use when storing and retrieving session data from Redis (default: `JSON.parse` and `JSON.stringify`).\n\nOptionally `parse` method can be async if need be.\n\n```ts\ninterface Serializer {\n  parse(string): object | Promise\u003cobject\u003e\n  stringify(object): string\n}\n```\n\n##### scanCount\n\nValue used for _count_ parameter in [Redis `SCAN` command](https://redis.io/commands/scan#the-count-option). Used for `ids()` and `all()` methods (default: `100`).\n\n[1]: https://github.com/NodeRedis/node-redis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fconnect-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftj%2Fconnect-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fconnect-redis/lists"}