{"id":19054378,"url":"https://github.com/datadog/cloudcraft-node","last_synced_at":"2026-03-16T16:35:48.761Z","repository":{"id":246375863,"uuid":"815264970","full_name":"DataDog/cloudcraft-node","owner":"DataDog","description":"Node.js client for the Cloudcraft developer API.","archived":false,"fork":false,"pushed_at":"2024-09-12T19:32:08.000Z","size":332,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"trunk","last_synced_at":"2025-04-17T06:23:30.040Z","etag":null,"topics":["api","api-client","aws","azure","client","cloudcraft","datadog","diagram","sdk"],"latest_commit_sha":null,"homepage":"https://www.cloudcraft.co/","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":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-3rdparty.csv","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-14T18:02:24.000Z","updated_at":"2024-09-27T00:13:39.000Z","dependencies_parsed_at":"2024-06-27T17:25:02.180Z","dependency_job_id":"a0d821c9-e3fc-4040-a83d-cd231c5f8814","html_url":"https://github.com/DataDog/cloudcraft-node","commit_stats":null,"previous_names":["datadog/cloudcraft-node"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fcloudcraft-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fcloudcraft-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fcloudcraft-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fcloudcraft-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/cloudcraft-node/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249391023,"owners_count":21263205,"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":["api","api-client","aws","azure","client","cloudcraft","datadog","diagram","sdk"],"created_at":"2024-11-08T23:38:05.951Z","updated_at":"2025-12-29T16:23:28.866Z","avatar_url":"https://github.com/DataDog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudcraft Node.js Library\n\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache2.0-yellow.svg)](LICENSE.md)\n[![Build Status](https://github.com/DataDog/cloudcraft-node/actions/workflows/ci.yml/badge.svg?branch=trunk)](https://github.com/DataDog/cloudcraft-node/actions?query=branch%3Atrunk)\n\n![Cloudcraft diagram](https://static.cloudcraft.co/sdk/cloudcraft-sdk-example-1.svg)\n\nVisualize your cloud architecture with Cloudcraft by Datadog,\n[the best way to create smart AWS and Azure diagrams](https://www.cloudcraft.co/).\n\nCloudcraft supports both manual and programmatic diagramming, as well as automatic reverse engineering of existing cloud\nenvironments into beautiful system architecture diagrams.\n\nThis `cloudcraft` Node library provides an easy-to-use native Node SDK for interacting with\n[the Cloudcraft API](https://docs.datadoghq.com/cloudcraft/api/).\n\nUse case examples:\n\n-   Snapshot and visually compare your live AWS or Azure environment before and after a deployment, in your app or as\n    part of your automated CI pipeline\n-   Download an inventory of all your cloud resources from a linked account as JSON\n-   Write a converter from a third party data format to Cloudcraft diagrams\n-   Backup, export \u0026 import your Cloudcraft data\n-   Programmatically create Cloudcraft diagrams\n\nThis SDK requires a [Cloudcraft API key](https://docs.datadoghq.com/cloudcraft/getting-started/generate-api-key/) to\nuse. A [free trial of Cloudcraft Pro](https://www.cloudcraft.co/pricing) with API access is available.\n\n## Requirements\n\nNode 22 or higher.\n\n## Installation\n\nTo install `cloudcraft`, run:\n\n```console\nnpm install cloudcraft --save\n```\n\nOr, if you prefer `yarn`:\n\n```console\nyarn add cloudcraft\n```\n\n## Usage\n\nThe API is accessed through the `Cloudcraft` class. An API key available through the Cloudcraft user interface is\nrequired when instantiating `Cloudcraft`. It can be passed to the class as an argument or through the\n`CLOUDCRAFT_API_KEY` environment variable:\n\n```js\nimport { Cloudcraft } from 'Cloudcraft';\n\nconst client = new Cloudcraft('api_key...');\n\n(async () =\u003e {\n    const user = await client.user.me();\n\n    console.log(user.name);\n})();\n```\n\n### Configuration\n\n#### Initialize with config object\n\nThe package can be initialized with several options:\n\n```js\nimport { Cloudcraft } from 'Cloudcraft';\n\nconst client = new Cloudcraft('api_key...', {\n    host: 'customhost',\n});\n```\n\n| Option              | Default               | Description                                      |\n| ------------------- | --------------------- | ------------------------------------------------ |\n| `maxNetworkRetries` | 10                    | The amount of times a request should be retried. |\n| `timeout`           | 80_000                | Maximum time each request can take in ms.        |\n| `host`              | `'api.cloudcraft.co'` | Host that requests are made to.                  |\n| `port`              | 443                   | Port that requests are made to.                  |\n| `protocol`          | `'https'`             | `'https'` or `'http'`.                           |\n\n### Blueprints\n\n#### List my blueprints\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprints = await client.blueprint.list();\n```\n\n#### Retrieve blueprint\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.get('id');\n```\n\n#### Create blueprint\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.create({\n    data: {\n        grid: 'standard',\n        name: 'My new blueprint',\n    },\n});\n```\n\n#### Update blueprint\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.get('id');\nblueprint.data.name = 'My updated blueprint';\n\nawait client.blueprint.update(blueprint);\n```\n\n#### Export blueprint as image\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.get('id');\nconst svg = (await client.blueprint.export(\n  blueprint.id,\n  Cloudcraft.BlueprintFormat.SVG\n)) as string;\n```\n\n#### Delete blueprint\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.get('id');\nawait client.blueprint.delete(blueprint.id);\n```\n\n### AWS Accounts\n\n#### Add AWS account\n\n```js\nconst client = new Cloudcraft();\n\nconst awsAccount = await client.awsAccount.create(\n    {\n        name: 'Test account',\n        roleArn: 'arn:...',\n    },\n    'us-east-1',\n);\n```\n\n#### List my AWS accounts\n\n```js\nconst client = new Cloudcraft();\n\nconst awsAccounts = await client.awsAccount.list();\n```\n\n#### Snapshot AWS account\n\n```js\nconst client = new Cloudcraft();\n\nconst awsAccounts = await client.awsAccount.list();\nconst awsAccount = awsAccounts.find(\n  (awsAccount) =\u003e awsAccount.id === 'id'\n) as any;\nconst svg = (await client.awsAccount.snapshot(\n  awsAccount.id,\n  'us-east-1',\n  Cloudcraft.BlueprintFormat.SVG\n)) as string;\n```\n\n#### Update AWS account\n\n```js\nconst client = new Cloudcraft();\n\nconst awsAccounts = await client.awsAccount.list();\nconst awsAccount = awsAccounts.find(\n  (awsAccount) =\u003e awsAccount.id === 'id'\n) as any;\nawsAccount.name = 'Updated account';\n\nconst updatedAWSAccount = await client.awsAccount.update(awsAccount);\n```\n\n#### Delete AWS account\n\n```js\nconst client = new Cloudcraft();\n\nconst awsAccounts = await client.awsAccount.list();\nconst awsAccount = awsAccounts.find(\n  (awsAccount) =\u003e awsAccount.id === 'id'\n) as any;\nawait client.awsAccount.delete(awsAccount.id);\n```\n\n#### Get my AWS IAM Role parameters\n\n```js\nconst client = new Cloudcraft();\n\nconst iamParameters = await client.awsAccount.iamParameters();\n```\n\n### Budgets\n\n#### Export budget for a blueprint\n\n```js\nconst client = new Cloudcraft();\n\nconst blueprint = await client.blueprint.create(testBlueprint);\n\nconst csv = (await client.budget.export(\n  blueprint.id,\n  Cloudcraft.BudgetFormat.CSV\n)) as string;\n```\n\n### Users\n\n#### Get my information\n\n```js\nconst client = new Cloudcraft();\n\nconst user = await client.user.me();\n```\n\n## Contributing\n\nAnyone can help make `cloudcraft` better. Check out [the contribution guidelines](CONTRIBUTING.md) for more information.\n\n---\n\nReleased under the [Apache-2.0 License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fcloudcraft-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fcloudcraft-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fcloudcraft-node/lists"}