{"id":13724041,"url":"https://github.com/patch-technology/patch-node","last_synced_at":"2026-01-17T04:15:03.443Z","repository":{"id":38337165,"uuid":"282749532","full_name":"patch-technology/patch-node","owner":"patch-technology","description":"Patch's Javascript client library - https://www.patch.io","archived":false,"fork":false,"pushed_at":"2025-12-30T22:45:13.000Z","size":1013,"stargazers_count":69,"open_issues_count":2,"forks_count":6,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-01-12T15:12:48.734Z","etag":null,"topics":["carbon","carbon-emissions","carbon-neutral","carbon-offsets","carbon-offsetting","javascript"],"latest_commit_sha":null,"homepage":"https://www.patch.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patch-technology.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2020-07-26T23:18:20.000Z","updated_at":"2025-11-08T06:00:27.000Z","dependencies_parsed_at":"2023-11-17T23:09:23.006Z","dependency_job_id":"ff9cc4b0-425c-44fa-bbd6-62eed0836055","html_url":"https://github.com/patch-technology/patch-node","commit_stats":{"total_commits":104,"total_committers":17,"mean_commits":6.117647058823529,"dds":0.7115384615384616,"last_synced_commit":"d4e3070f1e4981c5611033a1f3da331ae4b69661"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/patch-technology/patch-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch-technology%2Fpatch-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch-technology%2Fpatch-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch-technology%2Fpatch-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch-technology%2Fpatch-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patch-technology","download_url":"https://codeload.github.com/patch-technology/patch-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patch-technology%2Fpatch-node/sbom","scorecard":{"id":721783,"data":{"date":"2025-08-11","repo":{"name":"github.com/patch-technology/patch-node","commit":"d0c3a7500b7348e6a05f9964100a89fd4d666812"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Code-Review","score":9,"reason":"Found 17/18 approved changesets -- score normalized to 9","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":"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":"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":"Maintained","score":0,"reason":"1 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/health_check.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.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":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/patch-technology/patch-node/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/patch-technology/patch-node/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/patch-technology/patch-node/publish.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: npmCommand not pinned by hash: .github/workflows/health_check.yml:25","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:30","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:28","Info:   6 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   4 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   3 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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 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-v6h2-p8h4-qcjw"],"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-22T11:34:39.869Z","repository_id":38337165,"created_at":"2025-08-22T11:34:39.870Z","updated_at":"2025-08-22T11:34:39.870Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["carbon","carbon-emissions","carbon-neutral","carbon-offsets","carbon-offsetting","javascript"],"created_at":"2024-08-03T01:01:49.027Z","updated_at":"2026-01-17T04:15:03.436Z","avatar_url":"https://github.com/patch-technology.png","language":"JavaScript","readme":"# Patch JavaScript SDK\n\n![Test](https://github.com/patch-technology/patch-node/workflows/Test/badge.svg)\n[![npm version](https://badge.fury.io/js/%40patch-technology%2Fpatch@2x.svg)](https://www.npmjs.com/package/@patch-technology/patch)\n[![Discord](https://img.shields.io/discord/733029448558837792)](https://discord.gg/M23NnGR)\n\nThe official JavaScript package for the [Patch API](https://www.patch.io).\n\n## Documentation\n\nFor a complete API reference, check out [Patch's API Reference.](https://docs.patch.io)\n\n## Installation\n\n### NPM\n\n```shell\nnpm install @patch-technology/patch --save\n```\n\n### Yarn\n\n```shell\nyarn add @patch-technology/patch\n```\n\n### Requirements\n\n- Node 10+\n\n## Usage\n\n### Configuration\n\nAfter installing the package, you'll have to configure it with your API key which is available from the API key page in the Patch dashboard:\n\n```javascript\n// ES6+\nimport Patch from '@patch-technology/patch';\nconst patch = Patch('key_test_1234');\n\n// ES5\nvar patch = require('@patch-technology/patch').default('key_test_1234');\n```\n\n#### Peer dependencies\n\nFor environments that do not include the Node Standard Library, such as React Native, you will need to install the listed peer dependencies in order for the package to work as expected. You can install the peer dependencies by running:\n\n```\nnpm install install-peers\n```\n\n### Orders\n\n[API Reference](https://docs.patch.io/#/?id=orders)\n\n#### Examples\n\n```javascript\n// Create an order - you can create an order\n// providing either amount (and unit) or total_price (and currency), but not both\n\n// Create order with amount\nconst amount = 1_000_000; // Pass in the amount in unit specified\nconst unit = 'g';\npatch.orders.createOrder({ amount: amount, unit: unit });\n\n// Create an order with total price\nconst totalPrice = 500; // Pass in the total price in smallest currency unit (ie cents for USD).\nconst currency = 'USD';\npatch.orders.createOrder({ total_price: totalPrice, currency: currency });\n\n// Create order with the issued_to field (optional)\nconst amount = 1_000_000; // Pass in the amount in unit specified\nconst unit = 'g';\nconst issued_to = { email: 'issuee@companya.com', name: 'Olivia Jones' };\npatch.orders.createOrder({ amount: amount, unit: unit, issued_to: issued_to });\n\n// Retrieve an order\norderId = 'ord_test_1234'; // Pass in the order's id\npatch.orders.retrieveOrder(orderId);\n\n// Place an order\nconst orderId = 'ord_test_1234'; // Pass in the order's id\npatch.orders.placeOrder(orderId);\n\n// Place an order with the issued_to field (optional)\nconst orderId = 'ord_test_1234'; // Pass in the order's id\nconst issued_to = { email: 'issuee@companya.com', name: 'Olivia Jones' };\npatch.orders.placeOrder(orderId, { issued_to: issued_to });\n\n// Cancel an order\nconst orderId = 'ord_test_1234'; // Pass in the order's id\npatch.orders.cancelOrder(orderId);\n\n// Retrieve a list of orders\nconst page = 1; // Pass in which page of orders you'd like\npatch.orders.retrieveOrders({ page });\n```\n\n### Projects\n\nProjects are the ways Patch takes CO2 out of the air. They can represent reforestation, enhanced weathering, direct air carbon capture, etc. When you place an order via Patch, it is allocated to a project.\n\nWhen fetching Projects, you can add filters to the query to narrow the result. Currently supported filters are:\n\n- `country`\n- `type`\n- `minimumAvailableMass`\n\nYou can also set the `acceptLanguage` option to retrieve projects in a different language.\n\n[API Reference](https://docs.patch.io/#/?id=projects)\n\n#### Examples\n\n```javascript\n// Retrieve a project\nconst projectId = 'pro_test_1234'; // Pass in the project's ID\npatch.projects.retrieveProject(projectId);\n\n// Retrieve a list of projects\nconst page = 1; // Pass in which page of projects you'd like\npatch.projects.retrieveProjects({ page });\n\n// Retrieve a filtered list of projects\nconst country = 'CA'; // Pass in the country you'd like to get projects from\npatch.projects.retrieveProjects({ country });\n\n// Retrieve a filtered list of projects\nconst type = 'biomass'; // Pass in the project type you'd like to filter by\npatch.projects.retrieveProjects({ type });\n\n// Retrieve a filtered list of projects\nconst minimumAvailableMass = 100; // Pass in the minimum available inventory the projects should have\npatch.projects.retrieveProjects({ minimumAvailableMass });\n\n// Retrieve a project in another language\n// See http://docs.patch.test:3000/#/internationalization for more information and support languages\nconst projectId = 'pro_test_1234';\npatch.projects.retrieveProject(projectId, { acceptLanguage: 'fr' });\n```\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, the core of this library is generated programmatically. Complex additions made directly to the library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!\n\nOn the other hand, contributions to the README, as well as new test cases are always very welcome!\n\n### Build and manually test\n\nTo build and test the package locally, run:\n\n```sh\n$ npm run build\n```\n\nThis will generate a `dist` folder with the compiled code. Next you want to link the package and use it in a different folder.\n\nIn the patch-node folder, run:\n\n```sh\n$ npm link\n```\n\nNavigate to a different, empty folder:\n\n```sh\n$ cd ..\n$ mkdir test-patch-node\n$ cd test-patch-node\n```\n\nIn that repository, run the following command to use the locally built package:\n\n```sh\n$ npm link @patch-technology/patch\n```\n\nThis will create a `node_modules` directory in your test repository which will symlink to your locally built package. To test out the package, open a node REPL and import the package and run some queries.\n\n```sh\nSANDBOX_API_KEY=xxx node\n```\n\n```node\nconst Patch = require('@patch-technology/patch');\nconst patch = Patch.default(process.env.SANDBOX_API_KEY);\npatch.projects.retrieveProjects().then((response) =\u003e console.log(response));\n```\n\n### Run the specs\n\nBefore running the tests, make sure you set the test API key! Please use test API keys and not production ones, they usually start with `key_test_`.\nBe sure you navigate back to the root `patch-node` directory to run the tests.\n\n```sh\n$ export SANDBOX_API_KEY=\u003cPATCH_TEST_API_KEY\u003e\n```\n\nThen you are ready to run the tests:\n\n```sh\n$ npm run test\n```\n","funding_links":[],"categories":["Consumption"],"sub_categories":["Computation and Communication"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatch-technology%2Fpatch-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatch-technology%2Fpatch-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatch-technology%2Fpatch-node/lists"}