{"id":15059773,"url":"https://github.com/petrbroz/aps-sdk-node","last_synced_at":"2025-07-14T03:04:18.985Z","repository":{"id":35069973,"uuid":"150491384","full_name":"petrbroz/aps-sdk-node","owner":"petrbroz","description":"Tools for accessing Autodesk Forge APIs from modern Node.js apps.","archived":false,"fork":false,"pushed_at":"2024-10-31T01:50:13.000Z","size":2927,"stargazers_count":40,"open_issues_count":4,"forks_count":18,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2025-06-30T03:42:09.864Z","etag":null,"topics":["api","async","autodesk","forge","generator","nodejs"],"latest_commit_sha":null,"homepage":"https://petrbroz.github.io/forge-server-utils/docs/index.html","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/petrbroz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null}},"created_at":"2018-09-26T21:18:15.000Z","updated_at":"2025-04-02T08:09:16.000Z","dependencies_parsed_at":"2025-02-12T13:11:03.858Z","dependency_job_id":"5ca76cf1-4b89-4a67-bea6-c0e19647de8e","html_url":"https://github.com/petrbroz/aps-sdk-node","commit_stats":{"total_commits":469,"total_committers":8,"mean_commits":58.625,"dds":"0.32196162046908317","last_synced_commit":"26cab5aa42136dcd8de2725ecd0d0df7bb6cba51"},"previous_names":["petrbroz/forge-nodejs-utils","petrbroz/autodesk-forge-tools","petrbroz/forge-server-utils"],"tags_count":117,"template":false,"template_full_name":null,"purl":"pkg:github/petrbroz/aps-sdk-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbroz%2Faps-sdk-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbroz%2Faps-sdk-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbroz%2Faps-sdk-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbroz%2Faps-sdk-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrbroz","download_url":"https://codeload.github.com/petrbroz/aps-sdk-node/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbroz%2Faps-sdk-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265236738,"owners_count":23732493,"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","async","autodesk","forge","generator","nodejs"],"created_at":"2024-09-24T22:47:34.588Z","updated_at":"2025-07-14T03:04:18.921Z","avatar_url":"https://github.com/petrbroz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aps-sdk-node\n\n![Publish to NPM](https://github.com/petrbroz/aps-sdk-node/workflows/Publish%20to%20NPM/badge.svg)\n[![npm version](https://badge.fury.io/js/aps-sdk-node.svg)](https://badge.fury.io/js/aps-sdk-node)\n![node](https://img.shields.io/node/v/aps-sdk-node.svg)\n![npm downloads](https://img.shields.io/npm/dw/aps-sdk-node.svg)\n![platforms](https://img.shields.io/badge/platform-windows%20%7C%20osx%20%7C%20linux-lightgray.svg)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n\nUnofficial SDK for accessing [Autodesk Platform Services](https://aps.autodesk.com/) from Node.js applications\nand from browsers, built using [TypeScript](https://www.typescriptlang.org) and modern language features like\n[async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)\nor [generators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*).\n\n![Autodesk Platform Services](docs/logo.png)\n\n## Usage\n\n### Server Side\n\nThe TypeScript implementation is transpiled into CommonJS JavaScript module with type definition files,\nso you can use it both in Node.js projects, and in TypeScript projects:\n\n```js\n// JavaScript\nconst { DataManagementClient } = require('aps-sdk-node');\n```\n\n```ts\n// TypeScript\nimport {\n\tDataManagementClient,\n\tIBucket,\n\tIObject,\n\tIResumableUploadRange,\n\tDataRetentionPolicy\n} from 'aps-sdk-node';\n```\n\n#### Authentication\n\nIf you need to generate [2-legged tokens](https://aps.autodesk.com/en/docs/oauth/v2/tutorials/get-2-legged-token)\nmanually, you can use the `AuthenticationClient` class:\n\n```js\nconst { AuthenticationClient } = require('aps-sdk-node');\nconst { APS_CLIENT_ID, APS_CLIENT_SECRET } = process.env;\nconst auth = new AuthenticationClient(APS_CLIENT_ID, APS_CLIENT_SECRET);\nconst authentication = await auth.authenticate(['bucket:read', 'data:read']);\nconsole.log('2-legged token', authentication.access_token);\n```\n\nOther API clients in this library are typically configured using a simple JavaScript object\ncontaining either `client_id` and `client_secret` properties (for 2-legged authentication),\nor a single `token` property (for authentication using a pre-generated access token):\n\n```js\nconst { DataManagementClient, BIM360Client } = require('aps-sdk-node');\nconst dm = new DataManagementClient({ client_id: '...', client_secret: '...' });\nconst bim360 = new BIM360Client({ token: '...' });\n```\n\n#### Data Management\n\n```js\nconst { DataManagementClient } = require('aps-sdk-node');\nconst { APS_CLIENT_ID, APS_CLIENT_SECRET } = process.env;\nconst data = new DataManagementClient({ client_id: APS_CLIENT_ID, client_secret: APS_CLIENT_SECRET });\n\nconst buckets = await data.listBuckets();\nconsole.log('Buckets', buckets.map(bucket =\u003e bucket.bucketKey).join(','));\n\nconst objects = await data.listObjects('foo-bucket');\nconsole.log('Objects', objects.map(object =\u003e object.objectId).join(','));\n```\n\n#### Model Derivatives\n\n```js\nconst { ModelDerivativeClient } = require('aps-sdk-node');\nconst { APS_CLIENT_ID, APS_CLIENT_SECRET } = process.env;\nconst derivatives = new ModelDerivativeClient({ client_id: APS_CLIENT_ID, client_secret: APS_CLIENT_SECRET });\nconst job = await derivatives.submitJob('\u003cyour-document-urn\u003e', [{ type: 'svf', views: ['2d', '3d'] }]);\nconsole.log('Job', job);\n```\n\n#### Design Automation\n\n```js\nconst { DesignAutomationClient } = require('aps-sdk-node');\nconst { APS_CLIENT_ID, APS_CLIENT_SECRET } = process.env;\nconst client = new DesignAutomationClient({ client_id: APS_CLIENT_ID, client_secret: APS_CLIENT_SECRET });\nconst bundles = await client.listAppBundles();\nconsole.log('App bundles', bundles);\n```\n\n#### Reality Capture\n\n```js\nconst { OutputFormat, RealityCaptureClient, SceneType } = require('aps-sdk-node');\nconst { APS_CLIENT_ID, APS_CLIENT_SECRET } = process.env;\nconst recap = new RealityCaptureClient({ client_id: APS_CLIENT_ID, client_secret: APS_CLIENT_SECRET });\nconst options = {\n    scenename: '\u003cscene name\u003e',\n    scenetype: SceneType.Aerial,\n    format: OutputFormat.RecapPhotoMesh,\n    callback: '\u003ccallback\u003e'\n};\nconst photoscene = await recap.createPhotoScene(options);\nconsole.log('Photoscene', photoscene);\n```\n\n### Client Side (experimental)\n\nThe transpiled output from TypeScript is also bundled using [webpack](https://webpack.js.org),\nso you can use the same functionality in a browser. There is a caveat, unfortunately: at the moment\nit is not possible to request APS access tokens from the browser\ndue to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) limitations,\nso when creating instances of the various clients, instead of providing client ID and secret\nyou will have to provide the token directly.\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/aps-sdk-node/dist/browser/aps-sdk-node.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tconst data = new APS.DataManagementClient({ token: '\u003cyour access token\u003e' });\n\tconst deriv = new APS.ModelDerivativeClient({ token: '\u003cyour access token\u003e' });\n\tdata.listBuckets()\n\t\t.then(buckets =\u003e { console.log('Buckets', buckets); })\n\t\t.catch(err =\u003e { console.error('Could not list buckets', err); });\n\tderiv.submitJob('\u003cyour document urn\u003e', [{ type: 'svf', views: ['2d', '3d'] }])\n\t\t.then(job =\u003e { console.log('Translation job', job); })\n\t\t.catch(err =\u003e { console.error('Could not start translation', err); });\n\u003c/script\u003e\n```\n\nNote that you can also request a specific version of the library from CDN by appending `@\u003cversion\u003e`\nto the npm package name, for example, `https://cdn.jsdelivr.net/npm/aps-sdk-node@4.0.0/dist/browser/aps-sdk-node.js`.\n\n## Testing\n\n```bash\nexport APS_CLIENT_ID=\u003cyour-client-id\u003e\nexport APS_CLIENT_SECRET=\u003cyour-client-secret\u003e\nexport APS_BUCKET=\u003cyour-test-bucket\u003e\nexport APS_MODEL_URN=\u003ctesting-model-urn\u003e\nyarn run build # Transpile TypeScript into JavaScript\nyarn test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrbroz%2Faps-sdk-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrbroz%2Faps-sdk-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrbroz%2Faps-sdk-node/lists"}