{"id":50735373,"url":"https://github.com/wyre-technology/node-datto-saas-protection","last_synced_at":"2026-06-10T13:01:19.642Z","repository":{"id":355228380,"uuid":"1226741404","full_name":"wyre-technology/node-datto-saas-protection","owner":"wyre-technology","description":"Comprehensive Node.js/TypeScript client library for the Datto SaaS Protection (Backupify) REST API","archived":false,"fork":false,"pushed_at":"2026-06-09T02:45:03.000Z","size":468,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T03:20:47.233Z","etag":null,"topics":["api-client","backupify","datto","kaseya","m365","msp","saas-backup","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-05-01T19:26:06.000Z","updated_at":"2026-06-09T01:55:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wyre-technology/node-datto-saas-protection","commit_stats":null,"previous_names":["wyre-technology/node-datto-saas-protection"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wyre-technology/node-datto-saas-protection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-saas-protection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-saas-protection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-saas-protection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-saas-protection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyre-technology","download_url":"https://codeload.github.com/wyre-technology/node-datto-saas-protection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyre-technology%2Fnode-datto-saas-protection/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","backupify","datto","kaseya","m365","msp","saas-backup","sdk","typescript"],"created_at":"2026-06-10T13:01:18.678Z","updated_at":"2026-06-10T13:01:19.626Z","avatar_url":"https://github.com/wyre-technology.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @wyre-technology/node-datto-saas-protection\n\nComprehensive, fully-typed Node.js / TypeScript client library for the\n[Datto SaaS Protection (Backupify) REST API](https://api.datto.com/api/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 SaaS Protection endpoints: clients, domains, seats, backups, restores, activity, license\n- Bearer-token authentication\n- Cursor-based pagination via async iterators\n- Rate limiting tuned for the 60 req/min SaaS Protection limit, with concurrency capped at 4\n- Async restore queue + poll helpers (`restores.queue`, `restores.get`, `restores.waitFor`)\n- Typed error hierarchy with a region-mismatch hint baked into 401 messages\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-saas-protection\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 { DattoSaasProtectionClient } from '@wyre-technology/node-datto-saas-protection';\n\nconst client = new DattoSaasProtectionClient({\n  apiKey: process.env.DATTO_SAAS_API_KEY!,\n  region: 'us', // or 'eu'\n});\n\n// Iterate every customer client, fetching pages on demand\nfor await (const customer of client.clients.listAll({ limit: 100 })) {\n  console.log(customer.id, customer.name);\n}\n```\n\n## Configuration\n\n```typescript\nnew DattoSaasProtectionClient({\n  apiKey: 'bearer-token',\n\n  // Region selection — picks the regional base URL\n  region: 'us', // 'us' | 'eu', default 'us'\n\n  // Optional — override the base URL entirely (forward-compat)\n  apiUrl: 'https://api.datto.com/api/v1',\n\n  // Optional — tune client-side rate limiting\n  rateLimit: {\n    enabled: true,\n    maxRequests: 60,\n    windowMs: 60_000,\n    throttleThreshold: 0.8,\n    retryAfterMs: 5_000,\n    maxRetries: 3,\n    maxConcurrency: 4,\n  },\n});\n```\n\n## Regions\n\nDatto SaaS Protection is split across two regional control planes:\n\n| Region | Base URL                                  |\n| ------ | ----------------------------------------- |\n| `us`   | `https://api.datto.com/api/v1`      |\n| `eu`   | `https://api.eu.datto.com/api/v1`   |\n\n\u003e **Region stickiness**: an API key issued in one region cannot call the\n\u003e other region's endpoints. The upstream API surfaces this as a generic\n\u003e `401 Unauthorized` — the SDK includes a hint in\n\u003e `DattoSaasProtectionAuthenticationError.message` to verify the configured\n\u003e region matches the key.\n\n## Pagination\n\nCursor-based:\n\n```\nGET /clients?limit=100\n→ { items: [...], nextCursor: \"abc123\" }\n\nGET /clients?limit=100\u0026cursor=abc123\n```\n\nDefault `limit` is 50, max is 250. Iteration stops automatically when\n`nextCursor` is `null`.\n\n```typescript\n// Single page\nconst page = await client.clients.list({ limit: 100 });\n\n// Async iterator across all pages\nfor await (const c of client.clients.listAll({ limit: 250 })) { /* ... */ }\n```\n\n## Restores: queue + poll workflow\n\nRestores are asynchronous. Queue with `restores.queue`, then wait for the\nrestore to leave the `queued`/`running` state.\n\n```typescript\nconst { restoreId } = await client.restores.queue('seat-123', {\n  backupId: 'backup-789',\n});\n\nconst final = await client.restores.waitFor(restoreId, {\n  intervalMs: 30_000,    // default — do not poll faster\n  timeoutMs: 60 * 60_000,\n});\n\nif (final.status === 'failed') {\n  console.error('Restore failed:', final.error);\n}\n```\n\n\u003e **Workflow gotcha**: M365 restores into existing users require Graph API\n\u003e permissions on the target tenant. If those permissions are missing the\n\u003e upstream API does NOT reject at queue time — the restore is accepted,\n\u003e transitions to `running`, and then surfaces a `400` once it tries to write.\n\u003e Check `final.status === 'failed'` and `final.error` after `waitFor`.\n\n## Archived seats\n\nSeat list endpoints return only active seats by default. Pass\n`includeArchived: true` to include retained-but-deleted seats:\n\n```typescript\nfor await (const seat of client.seats.listAll(clientId, domainId, {\n  includeArchived: true,\n})) {\n  // ...\n}\n```\n\n## API surface\n\n```typescript\nclient.clients.list(params)\nclient.clients.listAll(params)\n\nclient.domains.list(clientId, params)\nclient.domains.listAll(clientId, params)\n\nclient.seats.list(clientId, domainId, { includeArchived?, ...params })\nclient.seats.listAll(clientId, domainId, { includeArchived?, ...params })\nclient.seats.get(seatId)\n\nclient.backups.list(seatId, params)\nclient.backups.listAll(seatId, params)\n\nclient.restores.queue(seatId, payload)\nclient.restores.get(restoreId)\nclient.restores.waitFor(restoreId, { intervalMs?, timeoutMs? })\n\nclient.activity.list(clientId, params)\nclient.activity.listAll(clientId, params)\n\nclient.license.getUsage(clientId)\n```\n\n## Error handling\n\n```typescript\nimport {\n  DattoSaasProtectionError,\n  DattoSaasProtectionAuthenticationError,\n  DattoSaasProtectionForbiddenError,\n  DattoSaasProtectionNotFoundError,\n  DattoSaasProtectionConflictError,\n  DattoSaasProtectionRateLimitError,\n  DattoSaasProtectionServerError,\n} from '@wyre-technology/node-datto-saas-protection';\n\ntry {\n  await client.seats.get('seat-123');\n} catch (err) {\n  if (err instanceof DattoSaasProtectionAuthenticationError) {\n    // Region mismatch? Wrong key? Read err.message for the hint.\n  } else if (err instanceof DattoSaasProtectionConflictError) {\n    // A restore is already queued for this seat\n  } else if (err instanceof DattoSaasProtectionRateLimitError) {\n    await new Promise((r) =\u003e setTimeout(r, err.retryAfter));\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-saas-protection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyre-technology%2Fnode-datto-saas-protection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyre-technology%2Fnode-datto-saas-protection/lists"}