{"id":50735374,"url":"https://github.com/wyre-technology/node-datto-bcdr","last_synced_at":"2026-06-10T13:01:19.731Z","repository":{"id":355518123,"uuid":"1225195920","full_name":"wyre-technology/node-datto-bcdr","owner":"wyre-technology","description":"Comprehensive, fully-typed Node.js/TypeScript library for the Datto BCDR (Backup Portal) API","archived":false,"fork":false,"pushed_at":"2026-06-09T01:55:21.000Z","size":864,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T03:18:12.055Z","etag":null,"topics":["api-client","backup","bcdr","datto","kaseya","msp","sdk","typescript"],"latest_commit_sha":null,"homepage":null,"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/wyre-technology.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2026-04-30T03:27:37.000Z","updated_at":"2026-06-09T01:55:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wyre-technology/node-datto-bcdr","commit_stats":null,"previous_names":["wyre-technology/node-datto-bcdr"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wyre-technology/node-datto-bcdr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-bcdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-bcdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-bcdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-bcdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyre-technology","download_url":"https://codeload.github.com/wyre-technology/node-datto-bcdr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-bcdr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34153483,"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-10T02:00:07.152Z","response_time":89,"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":["api-client","backup","bcdr","datto","kaseya","msp","sdk","typescript"],"created_at":"2026-06-10T13:01:18.788Z","updated_at":"2026-06-10T13:01:19.715Z","avatar_url":"https://github.com/wyre-technology.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @wyre-technology/node-datto-bcdr\n\nComprehensive, fully-typed Node.js / TypeScript client library for the\n[Datto BCDR (Backup Portal) API v1](https://api.datto.com/v1).\n\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n\n## Features\n\n- Full coverage of BCDR endpoints: devices, assets, backups, screenshots, offsite, alerts, activity log\n- HMAC-SHA256 request signing built in (no manual header construction)\n- Automatic page-based pagination via async iterators\n- Token-bucket rate limiting tuned for the 120 req/min Datto BCDR limit\n- Typed error hierarchy with a dedicated `DattoBcdrSignatureError` for clock-skew failures\n- ESM and CommonJS dual exports, full `.d.ts` types\n- Zero `any` in the public API\n\n## Install\n\n```bash\nnpm install @wyre-technology/node-datto-bcdr\n```\n\nThe package is published to GitHub Packages under the `@wyre-technology` scope.\nAdd this to a project-local `.npmrc`:\n\n```\n@wyre-technology:registry=https://npm.pkg.github.com\n```\n\n## Quick start\n\n```typescript\nimport { DattoBcdrClient } from '@wyre-technology/node-datto-bcdr';\n\nconst client = new DattoBcdrClient({\n  apiKey:       process.env.DATTO_BCDR_PUBLIC_KEY!,   // public key\n  apiSecretKey: process.env.DATTO_BCDR_PRIVATE_KEY!,  // private key (HMAC secret)\n});\n\n// List one page of devices\nconst page = await client.devices.list({ page: 1, perPage: 100 });\nconsole.log(page.pagination.totalItems);\n\n// Iterate every device, fetching pages on demand\nfor await (const device of client.devices.listAll({ perPage: 250 })) {\n  console.log(device.serialNumber, device.hostname);\n}\n```\n\n## Configuration\n\n```typescript\nnew DattoBcdrClient({\n  apiKey: 'public-key',\n  apiSecretKey: 'private-key',\n\n  // Optional — override base URL (defaults to https://api.datto.com/v1)\n  apiUrl: 'https://api.datto.com/v1',\n\n  // Optional — tune client-side rate limiting\n  rateLimit: {\n    enabled: true,\n    maxRequests: 120,\n    windowMs: 60_000,\n    throttleThreshold: 0.8,\n    retryAfterMs: 5_000,\n    maxRetries: 3,\n  },\n});\n```\n\n## Authentication: HMAC-SHA256 signing\n\nEvery request is signed with three headers:\n\n| Header                    | Value                                          |\n| ------------------------- | ---------------------------------------------- |\n| `X-Datto-API-Key`         | The public key                                 |\n| `X-Datto-API-Timestamp`   | Unix epoch seconds (UTC)                       |\n| `X-Datto-API-Signature`   | Hex-encoded HMAC-SHA256 of the canonical input |\n\nThe string-to-sign is:\n\n```\n\u003cMETHOD\u003e + \"\\n\" + \u003cURL_PATH_INCLUDING_QUERY\u003e + \"\\n\" + \u003cTIMESTAMP\u003e + \"\\n\" + \u003cBODY\u003e\n```\n\nFor GET requests the body is the empty string. **Query parameters are sorted\nalphabetically by key** before signing, and the same canonical URL is used\nfor both the fetch and the signature.\n\n\u003e **Clock skew matters.** Datto rejects requests whose timestamp is more than\n\u003e roughly 5 minutes off UTC. If your host clock drifts you will see\n\u003e `DattoBcdrSignatureError`s.\n\n## API surface\n\n```typescript\nclient.devices.list(params)                      // page of devices\nclient.devices.listAll(params)                   // async iterable\nclient.devices.get(serialNumber)\n\nclient.assets.list(serialNumber, params)\nclient.assets.listAll(serialNumber, params)\nclient.assets.get(serialNumber, agentId)\n\nclient.backups.list(serialNumber, agentId, params)\nclient.backups.listAll(serialNumber, agentId, params)\n\nclient.screenshots.list(serialNumber, agentId, params)\nclient.screenshots.listAll(serialNumber, agentId, params)\nclient.screenshots.getImage(serialNumber, agentId, epoch) // → Buffer (PNG)\n\nclient.offsite.get(serialNumber)\n\nclient.alerts.list(params)\nclient.alerts.listAll(params)\n\nclient.activity.list(params)\nclient.activity.listAll(params)\n```\n\n## Error handling\n\n```typescript\nimport {\n  DattoBcdrError,\n  DattoBcdrAuthenticationError,\n  DattoBcdrSignatureError,\n  DattoBcdrForbiddenError,\n  DattoBcdrNotFoundError,\n  DattoBcdrRateLimitError,\n  DattoBcdrServerError,\n} from '@wyre-technology/node-datto-bcdr';\n\ntry {\n  await client.devices.get('SN-1');\n} catch (err) {\n  if (err instanceof DattoBcdrSignatureError) {\n    // Likely clock skew — sync NTP\n  } else if (err instanceof DattoBcdrRateLimitError) {\n    await new Promise((r) =\u003e setTimeout(r, err.retryAfter));\n  } else if (err instanceof DattoBcdrNotFoundError) {\n    // ...\n  } else {\n    throw err;\n  }\n}\n```\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run typecheck\nnpm run lint\nnpm run build\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyre-technology%2Fnode-datto-bcdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyre-technology%2Fnode-datto-bcdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyre-technology%2Fnode-datto-bcdr/lists"}