{"id":19541612,"url":"https://github.com/brigadecore/brigade-sdk-for-js","last_synced_at":"2025-04-26T17:30:53.482Z","repository":{"id":37787267,"uuid":"324002692","full_name":"brigadecore/brigade-sdk-for-js","owner":"brigadecore","description":"JavaScript (and TypeScript) SDK for Brigade v2","archived":false,"fork":false,"pushed_at":"2023-03-14T15:10:52.000Z","size":359,"stargazers_count":4,"open_issues_count":5,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T16:27:47.791Z","etag":null,"topics":["brigade","javascript","typescript","v2"],"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/brigadecore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-23T21:13:22.000Z","updated_at":"2022-10-04T05:27:31.000Z","dependencies_parsed_at":"2024-11-11T03:11:22.383Z","dependency_job_id":"6342c084-1e9b-4c73-a40d-804e330c1fd5","html_url":"https://github.com/brigadecore/brigade-sdk-for-js","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-sdk-for-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-sdk-for-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-sdk-for-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-sdk-for-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brigadecore","download_url":"https://codeload.github.com/brigadecore/brigade-sdk-for-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025609,"owners_count":21524830,"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":["brigade","javascript","typescript","v2"],"created_at":"2024-11-11T03:11:16.367Z","updated_at":"2025-04-26T17:30:53.171Z","avatar_url":"https://github.com/brigadecore.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brigade SDK for JavaScript\n\n![build](https://badgr.brigade2.io/v1/github/checks/brigadecore/brigade-sdk-for-js/badge.svg?appID=99005)\n[![slack](https://img.shields.io/badge/slack-brigade-brightgreen.svg?logo=slack)](https://kubernetes.slack.com/messages/C87MF1RFD)\n\nThis is a Brigade 2-compatible SDK for JavaScript and TypeScript.\n\n## Supported Runtimes\n\nGreat care has been taken to ensure this SDK works within recent versions of\nNode as well as modern browsers (latest versions of Firefox, Chrome, Edge,\nSafari, etc.) _if properly transpiled with [webpack](https://webpack.js.org/) or\nsimilar_.\n\n## Installation\n\nInstall into your project using your favorite package manager.\n\nFor instance:\n\n```shell\n$ npm install --save @brigadecore/brigade-sdk\n```\n\nOr:\n\n```shell\n$ yarn add @brigadecore/brigade-sdk\n```\n\n## Basic Use\n\n__Note: All examples that follow use TypeScript.__\n\nA Brigade API client can be obtained as follows:\n\n```typescript\nimport { APIClient } from \"@brigadecore/brigade-sdk\"\n\n// ...\n\nconst client = new APIClient(apiAddress, apiToken, opts)\n```\n\nIn the example above, it is assumed:\n\n* `apiAddress` points to a Brigade 2 API server. The address must include the\n  protocol (i.e. must be prefixed with `http://` or `https://`).\n* `apiToken` is:\n    * A valid API token. It is probably best to use a non-expiring service\n      account token. Refer to Brigade's own documentation on how to obtain such\n      a token.\n    * The empty string is acceptable, but only API operations _not_ requiring\n      authorization will then be supported by the client.\n* `opts`, as one might infer, is an optional parameter. If included, it must be\n  an object, which may have a single field `allowInsecureConnections` containing\n  the value `true` or `false` to indicate whether SSL errors should be tolerated\n  by the client. If not specified, SSL errors will _not_ be tolerated. This\n  option is only applicable when the value of the `apiAddress` argument uses\n  `https://` as the scheme.\n\nThe `client` returned from the call to the `new APIClient(...)` constructor is\nthe root in a tree of more specialized clients.\n\nTo obtain a client for working with the \"core\" components of Brigade (Projects,\nEvents, etc.):\n\n```typescript\nconst coreClient = client.core()\n```\n\nThe `coreClient` permits navigation to even more specialized clients, for\nexample:\n\n```typescript\nconst projectsClient = coreClient.projects()\n```\n\nIf your program needs to interact with only a specific subset of the Brigade\nAPI, it is possible and encouraged to directly instantiate just the specific\nsubset of the client tree that is needed.\n\nFor instance, this example shows instantiation of _only_ the Events client--\nsomething that might be practical for a program such as a Brigade gateway, whose\nonly interaction with Brigade involves the creation of new Events:\n\n```typescript\nimport { core } from \"@brigadecore/brigade-sdk\"\n\n// ...\n\nconst eventsClient = new core.EventsClient(apiAddress, apiToken, opts)\n```\n\nThe arguments passed above are the same as in our initial example.\n\n## Further Examples\n\nWorking Node and browser-based examples are available in the\n[examples](./examples) directory.\n\n## Contributing\n\nThe Brigade project accepts contributions via GitHub pull requests. The\n[Contributing](CONTRIBUTING.md) document outlines the process to help get your\ncontribution accepted.\n\n## Support \u0026 Feedback\n\nWe have a slack channel!\n[Kubernetes/#brigade](https://kubernetes.slack.com/messages/C87MF1RFD) Feel free\nto join for any support questions or feedback, we are happy to help. To report\nan issue or to request a feature open an issue\n[here](https://github.com/brigadecore/brigade/brigade-sdk-for-js/issues)\n\n## Code of Conduct\n\nParticipation in the Brigade project is governed by the\n[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-sdk-for-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrigadecore%2Fbrigade-sdk-for-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-sdk-for-js/lists"}