{"id":13847295,"url":"https://github.com/Papooch/nestjs-cls","last_synced_at":"2025-07-12T08:31:32.443Z","repository":{"id":36994026,"uuid":"406075267","full_name":"Papooch/nestjs-cls","owner":"Papooch","description":"A continuation-local storage (async context) module compatible with NestJS's dependency injection.","archived":false,"fork":false,"pushed_at":"2025-07-10T12:58:33.000Z","size":12138,"stargazers_count":565,"open_issues_count":10,"forks_count":42,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-10T15:05:50.037Z","etag":null,"topics":["async","async-hooks","asynclocalstorage","cls","context","nestjs","request"],"latest_commit_sha":null,"homepage":"https://papooch.github.io/nestjs-cls/","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/Papooch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2021-09-13T17:53:57.000Z","updated_at":"2025-07-10T12:54:57.000Z","dependencies_parsed_at":"2023-01-17T12:45:23.881Z","dependency_job_id":"4349141e-87cd-4513-9298-e811508c6be2","html_url":"https://github.com/Papooch/nestjs-cls","commit_stats":{"total_commits":229,"total_committers":17,"mean_commits":"13.470588235294118","dds":"0.24454148471615722","last_synced_commit":"588de11f4945fd6007ed70e8250de3412d203838"},"previous_names":[],"tags_count":334,"template":false,"template_full_name":null,"purl":"pkg:github/Papooch/nestjs-cls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fnestjs-cls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fnestjs-cls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fnestjs-cls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fnestjs-cls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Papooch","download_url":"https://codeload.github.com/Papooch/nestjs-cls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fnestjs-cls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264876020,"owners_count":23677405,"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":["async","async-hooks","asynclocalstorage","cls","context","nestjs","request"],"created_at":"2024-08-04T18:01:15.930Z","updated_at":"2025-07-12T08:31:32.435Z","avatar_url":"https://github.com/Papooch.png","language":"TypeScript","readme":"# NestJS CLS (Async Context)\n\nA continuation-local storage module compatible with [NestJS](https://nestjs.com/)' dependency injection based on [AsyncLocalStorage](https://nodejs.org/api/async_context.html#async_context_class_asynclocalstorage).\n\n\u003e **Notice**: The documentation has been moved to [a dedicated website](https://papooch.github.io/nestjs-cls/).\n\n_Continuation-local storage allows to store state and propagate it throughout callbacks and promise chains. It allows storing data throughout the lifetime of a web request or any other asynchronous duration. It is similar to thread-local storage in other languages._\n\nSome common use cases that this library enables include:\n\n- Tracking the Request ID and other metadata for logging purposes\n- Keeping track of the user throughout the whole request\n- Making the dynamic Tenant database connection available everywhere in multi-tenant apps\n- Propagating the authentication level or role to restrict access to resources\n- Seamlessly propagating database transaction across services without breaking encapsulation and isolation by explicitly passing it around (**Now available with the [Transactional plugin](https://papooch.github.io/nestjs-cls/plugins/available-plugins/transactional)**)\n- Using \"request\" context in cases where actual REQUEST-scoped providers are not supported (passport strategies, cron controllers, websocket gateways, queue consumers, ...)\n    - **Replace REQUEST-scoped providers with [Proxy Providers](https://papooch.github.io/nestjs-cls/features-and-use-cases/proxy-providers).**\n\nMost of these are to some extent solvable using _REQUEST-scoped_ providers or passing the context as a parameter, but these solutions are often clunky and come with a whole lot of other issues.\n\n---\n\n## Documentation\n\n### ➡️ [Go to the documentation website](https://papooch.github.io/nestjs-cls/) 📖\n\n---\n\n## Contributing\n\nContributing to a community project is always welcome, please see the [Contributing guide](/CONTRIBUTING.md) :)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPapooch%2Fnestjs-cls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPapooch%2Fnestjs-cls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPapooch%2Fnestjs-cls/lists"}