{"id":14006888,"url":"https://github.com/scaleapi/scaleapi-node","last_synced_at":"2025-04-12T04:13:15.410Z","repository":{"id":65374161,"uuid":"72814209","full_name":"scaleapi/scaleapi-node","owner":"scaleapi","description":"The official Node SDK for Scale AI, the data platform for AI","archived":false,"fork":false,"pushed_at":"2024-01-10T13:12:44.000Z","size":2064,"stargazers_count":16,"open_issues_count":6,"forks_count":10,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-04-12T04:13:10.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.scale.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scaleapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-11-04T04:26:24.000Z","updated_at":"2025-04-09T10:11:24.000Z","dependencies_parsed_at":"2024-04-13T18:04:40.030Z","dependency_job_id":null,"html_url":"https://github.com/scaleapi/scaleapi-node","commit_stats":{"total_commits":57,"total_committers":19,"mean_commits":3.0,"dds":0.6666666666666667,"last_synced_commit":"542f7a72f2c3dfafaa81ae4273f2594565de2e4d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleapi%2Fscaleapi-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleapi%2Fscaleapi-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleapi%2Fscaleapi-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleapi%2Fscaleapi-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaleapi","download_url":"https://codeload.github.com/scaleapi/scaleapi-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514203,"owners_count":21116903,"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":[],"created_at":"2024-08-10T10:01:41.587Z","updated_at":"2025-04-12T04:13:15.386Z","avatar_url":"https://github.com/scaleapi.png","language":"TypeScript","readme":"![Hero](static/hero.png)\n\n# Scale Node Library\n\n[![npm shield](https://img.shields.io/npm/v/scaleapi)](https://www.npmjs.com/package/scaleapi)\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)\n\nThe Scale Node.js library provides access to the Scale API from JavaScript/TypeScript.\n\n## Documentation\n\nAPI reference documentation is available [here](https://docs.scale.com/reference/introduction).\n\n## Installation\n\n```\nnpm install scaleapi\n```\n\nor\n\n```\nyarn add scaleapi\n```\n\n## Usage\n\n[![Try it out](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/typescript-scaleapi-sdk?file=app.ts\u0026view=editor)\n\n```typescript\nimport { ScaleClient } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: 'YOUR_API_KEY',\n});\n\nconst batch = await scale.batches.create({\n  project: 'project-id',\n  name: 'My project',\n});\n\nconsole.log('Received response from Scale', response);\n```\n\n### Authentication\n\nYou can find your API keys on your [dashboard](https://scale.com/dashboard), which you can access by [logging in](https://scale.com/login) or [signing up](https://scale.com/signup).\n\nWhen you constuct the `ScaleClient`, you can pass in your API key.\n\n```typescript\nimport { ScaleClient } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: process.env.SCALE_API_KEY,\n});\n```\n\nYou can also pass a function:\n\n```typescript\nimport { ScaleClient } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: getScaleApiKey,\n});\n\nfunction getScaleApiKey() {\n  ...\n}\n```\n\n### IDE integration\n\nThe Scale SDK is crafted to give you a great experience in your IDE. All types are nested\nin the `Scale` export.\n\n```typescript\nimport { ScaleClient, Scale } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: process.env.SCALE_API_KEY,\n});\n\nconst batch: Scale.Batch = await scale.batches.create({\n  project: 'project-id',\n  name: 'My project',\n});\n```\n\nYou'll get autocomplete for methods:\n\n![Method autocomplete](static/method-autocomplete.png)\n\nand properties:\n\n![Property autocomplete](static/property-autocomplete.png)\n\nThe SDK is fully typed. If you're using TypeScript, you'll get compiler errors if misuse the SDK:\n\n![Compile error](static/compile-error.png)\n\n### Error handling\n\nWhen an error is encountered, a [`ScaleError`](src/errors/ScaleError.ts) is thrown. The error may contain\na `message` or a response `body`, which you can log to see additional information.\n\n```typescript\nimport { ScaleClient, ScaleError } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: process.env.SCALE_API_KEY,\n});\n\ntry {\n  const batch = await scale.batches.create({\n    project: 'project-id',\n    name: 'My project',\n  });\n  ...\n} catch (error) {\n  if (error instanceof ScaleError) {\n    console.error(\"Failed to create batch\", error.message, error.body);\n  } else {\n    console.error(error);\n  }\n}\n```\n\n#### Timeouts\n\nThe Scale SDK will timeout after 60 seconds. When this happens, a [`ScaleTimeoutError`](src/errors/ScaleTimeoutError.ts)\nis thrown:\n\n```typescript\nimport { ScaleClient, ScaleTimeoutError } from 'scaleapi';\n\nconst scale = new ScaleClient({\n  token: process.env.SCALE_API_KEY,\n});\n\ntry {\n  const batch = await scale.batches.create({\n    project: 'project-id',\n    name: 'My project',\n  });\n  ...\n} catch (error) {\n  if (error instanceof ScaleTimeoutError) {\n    console.error(\"Timed out while trying to create batch.\");\n  } else {\n    console.error(error);\n  }\n}\n```\n\n## Beta status\n\nThis SDK is in beta, and there may be breaking changes between versions without\na major version update. Therefore, we recommend pinning the package version to a\nspecific version in your package.json file. This way, you can install the same\nversion each time without breaking changes unless you are intentionally looking\nfor the latest version.\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated\nprogrammatically. Additions made directly to this library would have to be moved\nover to our generation code, otherwise they would be overwritten upon the next\ngenerated release. Feel free to open a PR as a proof of concept, but know that\nwe will not be able to merge it as-is. We suggest [opening an\nissue](https://github.com/scaleapi/scaleapi-node/issues) first to discuss with\nus!\n\nOn the other hand, contributions to the README are always very welcome!\n\n### 🌿 This SDK was generated by [Fern](https://github.com/fern-api/fern)","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleapi%2Fscaleapi-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaleapi%2Fscaleapi-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleapi%2Fscaleapi-node/lists"}