{"id":19054218,"url":"https://github.com/datadog/datadog-api-client-typescript","last_synced_at":"2026-06-30T15:01:00.296Z","repository":{"id":36951212,"uuid":"335255862","full_name":"DataDog/datadog-api-client-typescript","owner":"DataDog","description":"Typescript client for the Datadog API","archived":false,"fork":false,"pushed_at":"2026-06-28T17:10:58.000Z","size":187569,"stargazers_count":102,"open_issues_count":212,"forks_count":19,"subscribers_count":490,"default_branch":"master","last_synced_at":"2026-06-28T19:09:51.827Z","etag":null,"topics":["datadog","datadog-api","openai","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@datadog/datadog-api-client","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/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-02T10:48:09.000Z","updated_at":"2026-06-26T19:15:59.000Z","dependencies_parsed_at":"2023-10-16T22:40:22.901Z","dependency_job_id":"b2da3808-17ab-49a6-8cc0-6c772744be41","html_url":"https://github.com/DataDog/datadog-api-client-typescript","commit_stats":{"total_commits":1633,"total_committers":31,"mean_commits":52.67741935483871,"dds":0.1463563992651562,"last_synced_commit":"a3a85dce275596c04e814b2091dce4e6cd1d15d3"},"previous_names":[],"tags_count":538,"template":false,"template_full_name":null,"purl":"pkg:github/DataDog/datadog-api-client-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/datadog-api-client-typescript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34971626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["datadog","datadog-api","openai","typescript"],"created_at":"2024-11-08T23:37:08.261Z","updated_at":"2026-06-30T15:01:00.269Z","avatar_url":"https://github.com/DataDog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e The next major version iteration of `@datadog/datadog-api-client`, `v2`, is now in Preview.\n\u003e The `v2` splits the monolithic client into new logically grouped api package structure.\n\u003e See [MIGRATION.md](https://github.com/DataDog/datadog-api-client-typescript/blob/v2/MIGRATION.md) and the [`v2` branch](https://github.com/DataDog/datadog-api-client-typescript/tree/v2) branch for more details.\n\n# Node.js Datadog API Client\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThis repository contains a Node.js API client for the [Datadog API](https://docs.datadoghq.com/api/).\n\n## How to install\n\nThe package is under [@datadog/datadog-api-client](https://www.npmjs.com/package/@datadog/datadog-api-client) and can be installed through NPM or Yarn:\n\n```sh\n# NPM\nnpm install @datadog/datadog-api-client\n\n# Yarn\nyarn add @datadog/datadog-api-client\n```\n\n## Getting Started\n\nHere's an example getting a monitor:\n\n```typescript\nimport { client, v1 } from '@datadog/datadog-api-client';\n\nconst configuration = client.createConfiguration();\nconst apiInstance = new v1.MonitorsApi(configuration);\n\nlet params:v1.MonitorsApiGetMonitorRequest = {\n  // number | The ID of the monitor\n  monitorId: 1,\n};\n\napiInstance.getMonitor(params).then((data: v1.Monitor) =\u003e {\n  console.log('API called successfully. Returned data: ' + data);\n}).catch((error:any) =\u003e console.error(error));\n\n```\n\n### Authentication\n\nBy default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API.\nTo provide your own set of credentials, you need to set the appropriate keys on the configuration:\n\n```typescript\nimport { client } from '@datadog/datadog-api-client';\n\nconst configurationOpts = {\n  authMethods: {\n    apiKeyAuth: \"\u003cAPI KEY\u003e\",\n    appKeyAuth: \"\u003cAPPLICATION KEY\u003e\"\n  },\n};\n\nconst configuration = client.createConfiguration(configurationOpts);\n```\n\n### Unstable Endpoints\n\nThis client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints:\n\n```typescript\nconfiguration.unstableOperations[\"\u003cversion\u003e.\u003coperationName\u003e\"] = true\n```\n\nwhere `\u003coperationName\u003e` is the name of the method used to interact with that endpoint. For example: `listLogIndexes`, or `getLogsIndex`.\n\n### Changing Server\n\nWhen talking to a different server, like the `eu` instance, change the server variables:\n\n```typescript\nimport { client } from '@datadog/datadog-api-client';\n\nconst configuration = client.createConfiguration();\n\nconfiguration.setServerVariables({\n  site: \"datadoghq.eu\"\n});\n```\n\n### Disable compressed payloads\n\nIf you want to disable GZIP compressed responses, set the `compress` flag\non your configuration options:\n\n```typescript\nimport { client } from '@datadog/datadog-api-client';\nconst configurationOpts = {\n  httpConfig: {\n    compress: false\n  },\n};\n\nconst configuration = client.createConfiguration(configurationOpts);\n```\n\n### Enable requests logging\n\nIf you want to enable requests logging, set the `debug` flag on your configuration object:\n\n```typescript\nimport { client } from '@datadog/datadog-api-client';\nconst configurationOpts = {\n  debug: true\n};\n\nconst configuration = client.createConfiguration(configurationOpts);\n```\n\n### Enable retry \n\nTo enable the client to retry when rate limited (status 429) or status 500 and above:\n\n```typescript\nimport { client } from '@datadog/datadog-api-client';\nconst configurationOpts = {\n  enableRetry: true\n};\n\nconst configuration = client.createConfiguration(configurationOpts);\n```\nThe interval between 2 retry attempts will be the value of the x-ratelimit-reset response header when available. If not, it will be :\n\n```typescript\n(backoffMultiplier ** current_retry_count) * backoffBase\n```\nThe maximum number of retry attempts is 3 by default and can be modified with\n\n```typescript\nmaxRetries\n```\n\n### Adding timeout to requests\n\nTo add timeout or other mechanism to cancel requests, you need an abort\ncontroller, for example the one implemented by\n[abort-controller](https://www.npmjs.com/package/abort-controller). You can\nthen pass the `signal method to the HTTP configuration options:\n\n```typescript\nimport { client, v1 } from '@datadog/datadog-api-client';\nimport AbortController from 'abort-controller';\n\nconst controller = new AbortController();\nconst timeout = setTimeout(\n  () =\u003e { controller.abort(); },\n  1000,\n);\nconst configurationOpts = {\n  httpConfig: {\n    signal: controller.signal\n  },\n};\n\nconst configuration = client.createConfiguration(configurationOpts);\n\nconst apiInstance = new v1.MonitorsApi(configuration);\napiInstance.listMonitors().then((data: v1.Monitor[]) =\u003e {\n  console.log('API called successfully. Returned data: ' + data);\n}).catch((error:any) =\u003e console.error(error)).finally(() =\u003e clearTimeout(timeout));\n```\n\n### Pagination\n\nSeveral listing operations have a pagination method to help consume all the items available.\nFor example, to retrieve all your incidents:\n\n```typescript\nimport { client, v2 } from \"@datadog/datadog-api-client\";\n\nasync function main() {\n  const configuration = client.createConfiguration();\n  configuration.unstableOperations[\"v2.listIncidents\"] = true;\n  const apiInstance = new v2.IncidentsApi(configuration);\n\n  for await (const incident of apiInstance.listIncidentsWithPagination()) {\n      console.log(\"Got incident \" + incident.id);\n  }\n}\n\nmain();\n```\n\n### Zstd compression\n\nZstd compression support requires users to supply their own zstd compressor callback function.\nThe callback should accept string arg and return compressed Buffer data.\nCallback signature `(body: string) =\u003e Buffer`.\nFor example, using `zstd.ts` package:\n\n```typescript\nimport { compressSync } from 'zstd.ts'\nimport { client, v2 } from \"@datadog/datadog-api-client\";\n\nasync function main() {\n  const configurationOpts = {\n    zstdCompressorCallback: (body: string) =\u003e compressSync({input: Buffer.from(body, \"utf8\")})\n  }\n  const configuration = client.createConfiguration(configurationOpts);\n  const apiInstance = new v2.MetricsApi(configuration);\n  const params: v2.MetricsApiSubmitMetricsRequest = {\n      body: {\n          series: [\n              {\n                  metric: \"system.load.1\",\n                  type: 0,\n                  points: [\n                      {\n                          timestamp: Math.round(new Date().getTime() / 1000),\n                          value: 0.7,\n                      },\n                  ],\n              },\n          ],\n      },\n      contentEncoding: \"zstd1\",\n  };\n\n  apiInstance.submitMetrics(params).then((data: v2.IntakePayloadAccepted) =\u003e {\n    console.log(\n      \"API called successfully. Returned data: \" + JSON.stringify(data)\n    );\n  }).catch((error: any) =\u003e console.error(error));\n}\n\nmain();\n```\n\n### Configure proxy\n\nYou can provide custom `HttpLibrary` implementation with proxy support to `configuration` object. See example below:\n\n```typescript\nimport pako from \"pako\";\nimport bufferFrom from \"buffer-from\";\nimport fetch from \"node-fetch\";\nimport { HttpsProxyAgent } from \"https-proxy-agent\";\nimport { v1, client } from \"@datadog/datadog-api-client\";\n\nconst proxyAgent = new HttpsProxyAgent('http://127.0.0.11:3128');\n\nclass HttpLibraryWithProxy implements client.HttpLibrary {\n    public debug = false;\n\n    public send(request: client.RequestContext): Promise\u003cclient.ResponseContext\u003e {\n        const method = request.getHttpMethod().toString();\n        let body = request.getBody();\n\n        let compress = request.getHttpConfig().compress;\n        if (compress === undefined) {\n            compress = true;\n        }\n\n        const headers = request.getHeaders();\n        if (typeof body === \"string\") {\n            if (headers[\"Content-Encoding\"] === \"gzip\") {\n                body = bufferFrom(pako.gzip(body).buffer);\n            } else if (headers[\"Content-Encoding\"] === \"deflate\") {\n                body = bufferFrom(pako.deflate(body).buffer);\n            }\n        }\n\n        const resultPromise = fetch(request.getUrl(), {\n            method: method,\n            body: body as any,\n            headers: headers,\n            signal: request.getHttpConfig().signal,\n            compress: compress,\n            agent: proxyAgent,\n        }).then((resp: any) =\u003e {\n            const headers: { [name: string]: string } = {};\n            resp.headers.forEach((value: string, name: string) =\u003e {\n                headers[name] = value;\n            });\n\n            const body = {\n                text: () =\u003e resp.text(),\n                binary: () =\u003e resp.buffer(),\n            };\n            const response = new client.ResponseContext(resp.status, headers, body);\n            return response;\n        });\n\n        return resultPromise;\n    }\n}\n\nconst configuration = client.createConfiguration({httpApi: new HttpLibraryWithProxy()});\nconst apiInstance = new v1.DashboardsApi(configuration);\n\napiInstance\n    .listDashboards()\n    .then((data: v1.DashboardSummary) =\u003e {\n        console.log(\n            \"API called successfully. Returned data: \" + JSON.stringify(data)\n        );\n    })\n    .catch((error: any) =\u003e console.error(error));\n```\n\n## Documentation\n\nDocumentation for API endpoints can be found in [GitHub pages][github pages].\n\n## Contributing\n\nAs most of the code in this repository is generated, we will only accept PRs for files\nthat are not modified by our code-generation machinery (changes to the generated files\nwould get overwritten). We happily accept contributions to files that are not autogenerated,\nsuch as tests and development tooling.\n\n## Author\n\nsupport@datadoghq.com\n\n## License\n\n[Apache License, v2.0](LICENSE)\n\n[github pages]: https://datadoghq.dev/datadog-api-client-typescript/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-api-client-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fdatadog-api-client-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-api-client-typescript/lists"}