Overview
Import 3D models into your Vizbl account from your Node.js server.
@vizbl/node is the official Node.js library for the Developer API. One call uploads a 3D file, imports it as an object and, if you ask it to wait, returns the object's tinuuid and url. You pass the tinuuid to Core AR, the Android SDK and the iOS SDK to show the object.
Version 0.x
Until version 1.0, a minor release may change the API. Install an exact version and read the release notes on npm before you upgrade.
Requirements
- Node.js 20 or later.
- A secret key. The SDK sends it with every request, so run the SDK on your server only, never in a browser or an app.
Install
npm install --save-exact @vizbl/nodeThe package works with both import and require, and ships its TypeScript types.
What the SDK covers
| SDK method | Developer API endpoint | What it does |
|---|---|---|
objects.importModel() | POST /developer-api/uploads/presign per file, then POST /developer-api/objects/imports | Uploads one file or several variants, starts the import and, if you ask, waits for the object. |
uploads.presign() | POST /developer-api/uploads/presign | Gets a URL to upload a 3D file to. |
objects.imports.create() | POST /developer-api/objects/imports | Starts an import of uploaded files. |
objects.imports.get() | GET /developer-api/objects/imports/{jobId} | Reads an import job once. |
objects.imports.wait() | GET /developer-api/objects/imports/{jobId} | Reads an import job until it finishes. |
objects.delete() | DELETE /developer-api/objects/{tinuuid} | Deletes an object. |
For every other endpoint, such as editing objects, generations, rooms or the account, call the Developer API over HTTP.