{"id":46209291,"url":"https://github.com/corenzan/consentman","last_synced_at":"2026-03-03T08:57:05.612Z","repository":{"id":43708627,"uuid":"245031133","full_name":"corenzan/consentman","owner":"corenzan","description":"A lightweight (\u003c1KB) manager for complying with user consent.","archived":false,"fork":false,"pushed_at":"2023-03-03T13:58:11.000Z","size":214,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T19:38:34.707Z","etag":null,"topics":["consent","privacy","typescript"],"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/corenzan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-05T00:13:28.000Z","updated_at":"2020-03-10T17:56:28.000Z","dependencies_parsed_at":"2023-02-03T22:16:00.669Z","dependency_job_id":null,"html_url":"https://github.com/corenzan/consentman","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/corenzan/consentman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corenzan%2Fconsentman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corenzan%2Fconsentman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corenzan%2Fconsentman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corenzan%2Fconsentman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corenzan","download_url":"https://codeload.github.com/corenzan/consentman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corenzan%2Fconsentman/sbom","scorecard":{"id":304774,"data":{"date":"2025-08-11","repo":{"name":"github.com/corenzan/consentman","commit":"e38faac597479b7afc7f469ef90716e2b65c113c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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/default.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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/corenzan/consentman/default.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   1 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Vulnerabilities","score":0,"reason":"55 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T21:46:13.393Z","repository_id":43708627,"created_at":"2025-08-17T21:46:13.393Z","updated_at":"2025-08-17T21:46:13.393Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30038546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:58:30.252Z","status":"ssl_error","status_checked_at":"2026-03-03T06:58:15.329Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["consent","privacy","typescript"],"created_at":"2026-03-03T08:57:05.053Z","updated_at":"2026-03-03T08:57:05.607Z","avatar_url":"https://github.com/corenzan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/corenzan/consentman/Default)](https://github.com/corenzan/consentman/actions)\n[![Monthly Downloads on NPM](https://img.shields.io/npm/dm/consentman)](https://www.npmjs.com/package/consentman)\n\n---\n\n# Consentman\n\n\u003e A lightweight manager for complying with user consent.\n\n**Consentman** provides an API for setting, changing and storing user consent and handling the event of consent being given or revoked.\n\nDifferently from other similar projects it will **not** provide any user interface or automation. It's your job as a developer to actually start and stop tracking the user, for instance, if consent is granted or revoked, respectively.\n\n## Install\n\n```shell\n$ npm i --save consentman\n```\n\n## Usage\n\nAt a glance:\n\n```js\nimport {\n  addConsentSubject,\n  getConsent,\n  changeConsent,\n  enforceConsent\n} from \"consentman\";\n\naddConsentSubject(\"default\", state =\u003e {\n  switch (state) {\n    case \"allowed\":\n      console.log(\"Consent has been granted. Installing trackers.\");\n      break;\n\n    case \"blocked\":\n      console.log(\"Consent has been revoked. Removing trackers.\");\n      break;\n\n    default:\n      console.log(\"User needs to consent first.\");\n      break;\n  }\n});\n\nif (\"indeterminate\" === getConsent(\"default\").consent) {\n  if (confirm(\"Would you like to consent?\")) {\n    changeConsent(\"default\", \"granted\");\n  } else {\n    changeConsent(\"default\", \"revoked\");\n  }\n}\n\nenforceConsent();\n```\n\nOn the user's first visit to the website the consent named `default` will be `indeterminate`, so a confirmation will be shown asking the user for consent.\n\nIf the user clicks `Yes` consent will be granted and any subjects will get allowed.\n\nIf the user clicks `No` consent will be revoked and any subjects will be skipped.\n\nSubsequent visits by the user will **not** trigger the confirmation since consent is remembered across visits--stored in local storage.\n\nIf at any time `default` consent is revoked and re-enforced, any subjects will be blocked.\n\nYou can also have additional consents with different names, e.g. one for trackers, one for advertising, etc.\n\n## API\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003ccode\u003eaddConsentSubject(name: string, callback: (state: \"idle\" | \"allowed\" | \"blocked\" | \"skipped\") =\u003e void): void\u003c/code\u003e\n  \u003c/summary\u003e\n  \u003cp\u003ePush new consent subject to the registry. A consent subject is a state machine that updates whenever \u003ccode\u003eenforceConsent\u003c/code\u003e is called. The next state depends on whether a consent of same name has been granted or revoked.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003ccode\u003egetConsent(name: string): Entry\u003c/code\u003e\n  \u003c/summary\u003e\n  \u003cp\u003eReturn current consent entry with a given \u003ccode\u003ename\u003c/code\u003e. A consent entry has the following interface:\u003c/p\u003e\n  \u003cdl\u003e\n    \u003cdt\u003e\u003ccode\u003ename: string\u003c/code\u003e\u003c/dt\u003e\n    \u003cdd\u003eA string identifier.\u003c/dd\u003e\n    \u003cdt\u003e\u003ccode\u003edate: number\u003c/code\u003e\u003c/dt\u003e\n    \u003cdd\u003eTimestamp for when consent was last changed.\u003c/dd\u003e\n    \u003cdt\u003e\u003ccode\u003econsent: \"indeterminate\" | \"granted\" | \"revoked\"\u003c/code\u003e\u003c/dt\u003e\n    \u003cdd\u003eThe current policy.\u003c/dd\u003e\n  \u003c/dl\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003ccode\u003echangeConsent(name: string, consent: \"indeterminate\" | \"granted\" | \"revoked\"): void\u003c/code\u003e\n  \u003c/summary\u003e\n  \u003cp\u003eUpdate existing consent entry or create new one and save to storage.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003ccode\u003eenforceConsent(): void\u003c/code\u003e\n  \u003c/summary\u003e\n  \u003cp\u003eWalk over registered consent subjects and update their states.\u003c/p\u003e\n\u003c/details\u003e\n\n## License\n\nThis project is licensed under MIT. See [LICENSE.md](LICENSE.md) for full notice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorenzan%2Fconsentman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorenzan%2Fconsentman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorenzan%2Fconsentman/lists"}