{"id":20936205,"url":"https://github.com/adzerk/adzerk-decision-sdk-js","last_synced_at":"2026-02-19T03:08:31.794Z","repository":{"id":40297080,"uuid":"222592001","full_name":"adzerk/adzerk-decision-sdk-js","owner":"adzerk","description":"JavaScript SDK for the Kevel Decision API","archived":false,"fork":false,"pushed_at":"2025-07-21T23:08:48.000Z","size":2774,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-10-08T21:19:33.525Z","etag":null,"topics":["management"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adzerk.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}},"created_at":"2019-11-19T02:36:12.000Z","updated_at":"2025-04-09T16:17:35.000Z","dependencies_parsed_at":"2024-06-19T01:54:29.933Z","dependency_job_id":"6cb684b1-d308-46fa-b9c3-7664cdb4293f","html_url":"https://github.com/adzerk/adzerk-decision-sdk-js","commit_stats":{"total_commits":234,"total_committers":12,"mean_commits":19.5,"dds":0.2991452991452992,"last_synced_commit":"df81d4cf641357f9146a55af7b21a59a38777667"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/adzerk/adzerk-decision-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adzerk","download_url":"https://codeload.github.com/adzerk/adzerk-decision-sdk-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-js/sbom","scorecard":{"id":168599,"data":{"date":"2025-08-11","repo":{"name":"github.com/adzerk/adzerk-decision-sdk-js","commit":"23435e0c52997e3fb1b0b7e9bf7a280fd0931095"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"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":"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":"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":10,"reason":"all changesets reviewed","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.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":"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/nodejs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/adzerk/adzerk-decision-sdk-js/publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:42","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:45","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:23","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   4 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:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:8"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xq7p-g2vc-g82p","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-7hpj-7hhx-2fgx"],"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-16T15:42:47.918Z","repository_id":40297080,"created_at":"2025-08-16T15:42:47.918Z","updated_at":"2025-08-16T15:42:47.918Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29601574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T02:50:40.506Z","status":"ssl_error","status_checked_at":"2026-02-19T02:50:26.316Z","response_time":117,"last_error":"SSL_read: 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":["management"],"created_at":"2024-11-18T22:18:23.212Z","updated_at":"2026-02-19T03:08:31.779Z","avatar_url":"https://github.com/adzerk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adzerk JavaScript/Typescript Decision SDK\n\nJavaScript Software Development Kit for Adzerk Decision \u0026 UserDB APIs\n\nUsable client or server-side as TypeScript or JavaScript!\n\n## Installation\n\n[NPM Package](https://www.npmjs.com/package/@adzerk/decision-sdk)\n\n### Server-Side via NPM\n\nRequires [Node.js v20](https://nodejs.org/en/about/releases/) or higher.\n\n```shell\nnpm install --save @adzerk/decision-sdk\n```\n\n### Client-Side via CDN\n\nAlways fetches the latest version:\n\n```html\n\u003cscript src=\"https://unpkg.com/@adzerk/decision-sdk/dist/adzerk-decision-sdk.js\"\u003e\u003c/script\u003e\n```\n\nUsing a fixed version:\n\n```html\n\u003cscript src=\"https://unpkg.com/@adzerk/decision-sdk@1.0.0-beta.2/dist/adzerk-decision-sdk.js\"\u003e\u003c/script\u003e\n```\n\n## Examples\n\n### API Credentials \u0026 Required IDs\n\n- Network ID: Log into [Adzerk UI](https://app.adzerk.com/) \u0026 use the \"circle-i\" help menu in upper right corner to find Network ID. Required for all SDK operations.\n- Site ID: Go to [Manage Sites page](https://app.adzerk.com/#!/sites/) to find site IDs. Required when fetching an ad decision.\n- Ad Type ID: Go to [Ad Sizes page](https://app.adzerk.com/#!/ad-sizes/) to find Ad Type IDs. Required when fetching an ad decision.\n- API Key: Go to [API Keys page](https://app.adzerk.com/#!/api-keys/) find active API keys. Required when writing to UserDB.\n- User Key: UserDB IDs are [specified or generated for each user](https://dev.adzerk.com/reference/userdb#passing-the-userkey).\n\n### Fetching an Ad Decision\n\n```javascript\nimport { Client } from \"@adzerk/decision-sdk\";\n\n// Demo network, site, and ad type IDs; find your own via the Adzerk UI!\nlet client = new Client({ networkId: 23, siteId: 667480 });\n\nlet request = {\n  placements: [{ adTypes: [5] }],\n  user: { key: \"abc\" },\n  keywords: [\"keyword1\", \"keyword2\"]\n};\n\nclient.decisions.get(request).then(response =\u003e {\n  console.dir(response, { depth: null });\n});\n```\n\n### Recording Impression \u0026 Clicks\n\nUse with the fetch ad example above.\n\n```javascript\n// Impression pixel; fire when user sees the ad\nclient.pixels.fire({ url: decision.impressionUrl });\n\n// Click pixel; fire when user clicks on the ad\n// status: HTTP status code\n// location: click target URL\nclient.pixels.fire({ url: decision.clickUrl }).then(r =\u003e {\n  console.log(`status ${r[\"status\"]}; location: ${r[\"location\"]}`);\n});\n```\n\n### UserDB: Reading User Record\n\n```javascript\nimport { Client } from \"@adzerk/decision-sdk\";\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Client({ networkId: 23 });\nclient.userDb.read(\"abc\").then(response =\u003e console.log(response));\n```\n\n### UserDB: Setting Custom Properties\n\n```javascript\nimport { Client } from \"@adzerk/decision-sdk\";\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Client({ networkId: 23 });\n\nlet props = {\n  favoriteColor: \"blue\",\n  favoriteNumber: 42,\n  favoriteFoods: [\"strawberries\", \"chocolate\"]\n};\n\nclient.userDb.setCustomProperties(\"abc\", props);\n```\n\n### UserDB: Forgetting User Record\n\n```javascript\nimport { Client } from \"@adzerk/decision-sdk\";\n\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Demo network ID and API key; find your own via the Adzerk UI!\nlet client = new Client({ networkId: 23, apiKey });\nclient.userDb.forget(\"abc\");\n```\n\n### Decision Explainer\n\nThe Decision Explainer returns information on a Decision API request explaining why each candidate ad was or was not chosen.\n\n```javascript\nimport { Client } from \"@adzerk/decision-sdk\";\n\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Demo network, site, and ad type IDs; find your own via the Adzerk UI!\nlet client = new Client({ networkId: 23, siteId: 667480 });\n\nlet request = {\n  placements: [{ adTypes: [5] }],\n  user: { key: \"abc\" },\n  keywords: [\"keyword1\", \"keyword2\"]\n};\n\nconst options = {\n  includeExplanation: true,\n  apiKey\n};\n\nclient.decisions.get(request, options).then(response =\u003e {\n  console.dir(response, { depth: null });\n});\n```\n\nThe response returns a decision object with placement, buckets, rtb logs, and result information.\n\n```json\n{\n  \"div0\": {\n    \"placement\": {},\n    \"buckets\": [],\n    \"rtb_log\": [],\n    \"results\": []\n  }\n}\n```\n\nThe \"placement\" object represents a decision in which an ad may be served. A Explainer Request can have multiple placements in the request.\nThe \"buckets\" array contains channel and priority information.\nThe \"rtb_logs\" array contains information about Real Time Bidding.\nThe \"results\" array contains the list of candidate ads that did and did not serve, along with a brief explanation. |\n\n### Logging\n\nOur logging implementation is meant to be flexible enough to fit into any common NodeJS logging framework.\n\nWhen constructing a client instance, the logger is passed in as an anonymous function with three parameters:\n\n- `level`: Any one of `debug`, `info`, `warn`, or `error`\n- `message`: The message to log\n- `metadata`: Any additional metadata related to the logging call\n\nIf no `logger` is provided as an argument, the [debug](https://github.com/visionmedia/debug#readme) library will be used by default.\n\nThe easiest way to integrate is to write a function that handles translating the data from the Adzerk SDK Logger into whatever logging framework you're using in the rest of your application:\n\n```js\nimport { Client } from \"@adzerk/decision-sdk\";\n\nconst logger = (lvl, msg, meta) =\u003e\n  console.log(`[${lvl}] ${msg} [${JSON.stringify(meta)}]\\n`);\n\nlet client = new Client({ logger });\n```\n\n## Documentation\n\n- [Adzerk API Documentation](https://dev.adzerk.com/reference)\n- [Adzerk User \u0026 Developer Documentation](https://dev.adzerk.com/docs)\n\n## Contributing\n\n### Reporting Issues\n\n- For bug fixes and improvements to this SDK please use Github to [open an issue](https://github.com/adzerk/adzerk-decision-sdk-js/issues) or send us a [pull request](https://github.com/adzerk/adzerk-decision-sdk-js/pulls).\n- For questions or issues regarding Adzerk functionality, please [contact Adzerk support](https://adzerk.com/help/).\n\n### Building / Running Tests\n\nTo install dependencies and run the builds associated with this SDK, please use:\n\n```\nnpm install\nnpm run build\nnpm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-js/lists"}