{"id":19014949,"url":"https://github.com/gradientedge/commercetools-utils","last_synced_at":"2026-01-30T22:29:07.963Z","repository":{"id":38173846,"uuid":"336343996","full_name":"gradientedge/commercetools-utils","owner":"gradientedge","description":"An easy to use toolkit for working with the commercetools HTTP Authorization API.","archived":false,"fork":false,"pushed_at":"2025-11-18T10:57:14.000Z","size":102655,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-11-18T11:05:53.177Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gradientedge.github.io/commercetools-utils/","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/gradientedge.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,"dco":null,"cla":null}},"created_at":"2021-02-05T17:37:05.000Z","updated_at":"2025-11-18T10:55:45.000Z","dependencies_parsed_at":"2025-04-23T01:40:02.144Z","dependency_job_id":"d35a2b89-5199-4856-b418-357655961da1","html_url":"https://github.com/gradientedge/commercetools-utils","commit_stats":{"total_commits":225,"total_committers":7,"mean_commits":"32.142857142857146","dds":0.1466666666666666,"last_synced_commit":"1dd6e32513e58893fe499cbce2fcd31c61db0e80"},"previous_names":[],"tags_count":193,"template":false,"template_full_name":null,"purl":"pkg:github/gradientedge/commercetools-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradientedge%2Fcommercetools-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradientedge%2Fcommercetools-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradientedge%2Fcommercetools-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradientedge%2Fcommercetools-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gradientedge","download_url":"https://codeload.github.com/gradientedge/commercetools-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradientedge%2Fcommercetools-utils/sbom","scorecard":{"id":443060,"data":{"date":"2025-08-11","repo":{"name":"github.com/gradientedge/commercetools-utils","commit":"7d316e0b2387a7c137bedf41d9ed1baac4e4fac4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.1,"checks":[{"name":"Code-Review","score":6,"reason":"Found 9/14 approved changesets -- score normalized to 6","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":"Maintained","score":10,"reason":"24 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/release.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":"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:19: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/gradientedge/commercetools-utils/release.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/build.yml:15","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:14","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   2 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":"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":"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":-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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:7"],"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":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","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":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"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-19T05:59:53.923Z","repository_id":38173846,"created_at":"2025-08-19T05:59:53.923Z","updated_at":"2025-08-19T05:59:53.923Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28921087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-08T19:34:17.377Z","updated_at":"2026-01-30T22:29:07.941Z","avatar_url":"https://github.com/gradientedge.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Coverage][coverage]][codecov-url]\n\n# Gradient Edge commercetools utils\n\nAn easy-to-use toolkit for working with the commercetools HTTP API:\nhttps://docs.commercetools.com/api/\n\n**Please note:** this API is being built out bit by bit. If you're looking to use a method\nthat doesn't appear to exist, please either raise an issue or feel free to make the change\nyourself and raise a PR 👍\n\nSee full documentation here: [API documentation](https://gradientedge.github.io/commercetools-utils/).\n\n## How does this compare to the official commercetools SDK?\n\nWe think it's easier to use and less verbose. On the flip side, the \n[official commercetools SDK](https://github.com/commercetools/commercetools-sdk-typescript) is\nmore flexible and certainly more complete and up to date.\n\n## Installation\n\nSimply install the `@gradientedge/commercetools-utils` package using your package manager, e.g.:\n\n```shell\nnpm install --save @gradientedge/commercetools-utils\n```\n\n## Code examples\n\nFor clarity, we use the term **grant** to describe the object that holds the access token,\nrefresh token, scope and expiry details.\n\n### Creating a client grant\n\n```typescript\nimport { Region, CommercetoolsAuth, CommercetoolsGrant } from '@gradientedge/commercetools-utils'\n\nasync function example() {\n  const auth = new CommercetoolsAuth({\n    projectKey: 'your-project-key',\n    clientId: 'your-client-id',\n    clientSecret: 'your-client-secret',\n    region: Region.EUROPE_GCP,\n    clientScopes: ['create_anonymous_token']\n  })\n\n  let grant: CommercetoolsGrant\n\n  try {\n    const grant = await auth.getClientGrant()\n    console.log('Grant:', grant)\n  } catch (error) {\n    // 'error' will likely be an instance of CommercetoolsError.\n    // See the API for full details.\n    console.error(error)\n    throw error\n  }\n}\n\nexample()\n```\n\n### Logging in a customer\n\n```typescript\nimport { Region, CommercetoolsAuth, CommercetoolsGrant } from '@gradientedge/commercetools-utils'\n\nasync function example() {\n  const auth = new CommercetoolsAuth({\n    projectKey: 'your-project-key',\n    clientId: 'your-client-id',\n    clientSecret: 'your-client-secret',\n    region: Region.EUROPE_GCP,\n    clientScopes: ['create_anonymous_token']\n  })\n\n  let grant: CommercetoolsGrant\n\n  try {\n    const grant = await auth.login({\n      username: 'myUsername',\n      password: 'myPassword'\n    })\n    console.log('Grant:', grant)\n  } catch (error) {\n    console.error(error)\n    throw error\n  }\n}\n\nexample()\n```\n\nNote that the `getClientGrant` method here could be swapped out for say, `login`, in order to login a customer.\nThere is no need to call `getClientGrant` before calling `login`. Ensuring that there's an active client grant\nwill be taken care of by the `CommercetoolsAuth` class.\n\n### Get an anonymous customer grant\n\n```typescript\nimport { Region, CommercetoolsAuth, CommercetoolsGrant } from '@gradientedge/commercetools-utils'\n\nasync function example() {\n  const auth = new CommercetoolsAuth({\n    projectKey: 'your-project-key',\n    clientId: 'your-client-id',\n    clientSecret: 'your-client-secret',\n    region: Region.EUROPE_GCP,\n    clientScopes: ['create_anonymous_token']\n  })\n\n  let grant: CommercetoolsGrant\n\n  try {\n    const grant = await auth.getAnonymousGrant()\n    console.log('Grant:', grant)\n  } catch (error) {\n    console.error(error)\n    throw error\n  }\n}\n\nexample()\n```\n\n### Refresh an existing customer grant\n\nThe code below demonstrates how we can call the `refreshCustomerGrant` method with the `refreshToken` of an\nexisting grant. Realistically, that grant would probably have come from something like a JWT that was passed\nto your back-end server by your UI.\n\n```typescript\nimport { Region, CommercetoolsAuth, CommercetoolsGrant } from '@gradientedge/commercetools-utils'\n\nasync function example() {\n  const auth = new CommercetoolsAuth({\n    projectKey: 'your-project-key',\n    clientId: 'your-client-id',\n    clientSecret: 'your-client-secret',\n    region: Region.EUROPE_GCP,\n    clientScopes: ['create_anonymous_token']\n  })\n\n  let grant: CommercetoolsGrant\n\n  try {\n    const grant = await auth.login({\n      username: 'myUsername',\n      password: 'myPassword'\n    })\n    console.log('Grant:', grant)\n  } catch (error) {\n    console.error(error)\n    throw error\n  }\n\n  // The 'grant' would have been\n  const refreshToken = grant.refreshToken\n  try {\n    const grant = await auth.refreshCustomerGrant(refreshToken)\n    console.log('Refreshed grant:', grant)\n  } catch (error) {\n    console.error(error)\n    throw error\n  }\n}\n\nexample()\n```\n\n[codecov-url]: https://app.codecov.io/gh/gradientedge/commercetools-utils\n[coverage]: https://codecov.io/gh/gradientedge/commercetools-utils/branch/main/graph/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradientedge%2Fcommercetools-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgradientedge%2Fcommercetools-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradientedge%2Fcommercetools-utils/lists"}