New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@vizbl/node

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vizbl/node

Official Node.js SDK for the Vizbl Developer API

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
1
-80%
Maintainers
2
Weekly downloads
 
Created
Source

Vizbl Node.js SDK

Official Node.js SDK for the Vizbl Developer API.

Installation

npm install @vizbl/node

Quick Start

import Vizbl from '@vizbl/node';

const vizbl = new Vizbl();

const result = await vizbl.objects.importModel({
  file: './chair.glb',
  name: 'Chair',
  wait: true,
});

console.log(result.tinuuid, result.url);

By default the SDK reads VIZBL_API_KEY from the environment and sends requests to https://api.vizbl.com.

Configuration

const vizbl = new Vizbl({
  apiKey: process.env.VIZBL_API_KEY,
  baseURL: 'https://api-dev.vizbl.com',
  timeoutMs: 30_000,
});
OptionDescription
apiKeyDeveloper API secret key. Defaults to process.env.VIZBL_API_KEY.
baseURLDeveloper API base URL. Defaults to process.env.VIZBL_BASE_URL, or https://api.vizbl.com.
timeoutMsOptional timeout in milliseconds for API requests and direct uploads.
fetchOptional custom Fetch API implementation.
defaultHeadersAdditional headers sent with Developer API requests.

API Reference

vizbl.objects.importModel(options)

Uploads one local model file or ordered model variants, creates an import job, and optionally waits for completion.

const job = await vizbl.objects.importModel({
  file: './chair.glb',
  name: 'Chair',
  wait: true,
});
OptionDescription
fileLocal path, Blob, ArrayBuffer, Uint8Array, or `{ path
variantsOrdered source variants for multi-variant imports. The first variant is the main/default variant. Use either variants or file.
namePublic object name. Defaults to the first file name without extension.
descriptionOptional public object description.
tagsOptional public object tags.
categoryOptional Vizbl category id.
mechanicOptional placement mechanic: all, floor, wall, or ceiling.
ai_generateRequests best-effort AI preview generation when supported.
idempotencyKeyOptional key for safely retrying import job creation.
uploadConcurrencyMaximum number of variant files uploaded in parallel. Defaults to 2.
signalOptional AbortSignal cancelling file resolution, presign, upload, and import job creation. Also cancels polling when wait is used without its own signal.
waitPass true to wait for completion, false/omit to return the queued job, or pass { pollIntervalMs, maxWaitMs, signal }.

When wait: true is used, the returned job includes tinuuid and url after a successful import.

const result = await vizbl.objects.importModel({
  name: 'Chair',
  variants: [
    { file: './chair-oak.glb', name: 'Oak' },
    { file: './chair-walnut.glb', name: 'Walnut' },
  ],
  wait: true,
});

console.log(result.tinuuid, result.url);

vizbl.objects.imports.create(request, options?)

Creates an import job from already uploaded source model variants. Use this when you want manual control over presign and direct upload.

const presign = await vizbl.uploads.presign({
  type: 'model_source',
  fileName: 'chair.glb',
  fileSize: 123456,
  fileType: 'model/gltf-binary',
});

// Upload the file to presign.uploadUrl with presign.uploadFields first.

const job = await vizbl.objects.imports.create({
  name: 'Chair',
  variants: [{ name: 'Default', uploadId: presign.uploadId }],
});

options.idempotencyKey sends the x-idempotency-key header.

vizbl.objects.imports.get(jobId)

Gets the current import job status, stage, warnings, error, tinuuid, and url when available.

const job = await vizbl.objects.imports.get('job-id');

vizbl.objects.imports.wait(jobId, options?)

Polls an import job until it succeeds, fails, times out, or is aborted.

const result = await vizbl.objects.imports.wait('job-id', {
  pollIntervalMs: 2_000,
  maxWaitMs: 15 * 60_000,
});

vizbl.objects.delete(tinuuid)

Deletes a published Vizbl object by public tinuuid.

await vizbl.objects.delete('tin_123');

vizbl.uploads.presign(request)

Creates a presigned upload session for a source model file. Most applications should use objects.importModel, which handles presign and upload internally.

const presign = await vizbl.uploads.presign({
  type: 'model_source',
  fileName: 'chair.glb',
  fileSize: 123456,
  fileType: 'model/gltf-binary',
});

Errors

The SDK throws VizblApiError for API, validation, auth, upload, and timeout failures. High-level import polling throws VizblImportError when a job fails or times out.

import { VizblApiError } from '@vizbl/node';

try {
  await vizbl.objects.importModel({ file: './chair.glb', wait: true });
} catch (error) {
  if (error instanceof VizblApiError && error.isAuthError()) {
    console.error('Check VIZBL_API_KEY');
  }
}

Development

pnpm install
pnpm generate
pnpm typecheck
pnpm test
pnpm build
pnpm validate

pnpm validate checks both @vizbl/node and @vizbl/mcp.

To refresh the OpenAPI schema from a deployed Developer API:

pnpm fetch-openapi
# or
VIZBL_OPENAPI_URL=https://api-dev.vizbl.com/developer-api/docs-json pnpm fetch-openapi

Local MCP Server

This repository also publishes @vizbl/mcp, a local stdio MCP server for agents like Codex and Claude Desktop. It uses @vizbl/node under the hood.

Codex:

codex mcp add vizbl \
  --env VIZBL_API_KEY=your_api_key \
  -- npx -y @vizbl/mcp

Claude Desktop:

{
  "mcpServers": {
    "vizbl": {
      "command": "npx",
      "args": ["-y", "@vizbl/mcp"],
      "env": {
        "VIZBL_API_KEY": "your_api_key"
      }
    }
  }
}

Available tools:

  • vizbl_import_model
  • vizbl_get_import
  • vizbl_wait_import
  • vizbl_delete_object

Note: vizbl_import_model defaults wait to true, the opposite of the SDK's objects.importModel default (false/omit), since agent workflows generally want the final result rather than a queued job id.

Architecture documentation

The cross-repository Remote MCP architecture, implementation plan, and team backlogs are documented in docs/remote-mcp/README.md.

Keywords

vizbl

FAQs

Package last updated on 28 Jul 2026

Related posts