Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

JavaScript / TypeScript

Write and read records from Node.js or the browser with the Norbix JavaScript / TypeScript SDK.

The JavaScript / TypeScript SDK is @norbix.ai/ts (source: github.com/norbix-code/sdk-ts). It runs in Node.js 18 or newer and in the browser, and ships its own TypeScript types.

This page was run on 2026-10-06 with @norbix.ai/ts 4.13.0 and Node.js 24. All the code below is one file, quickstart.mjs: put the blocks one after the other.

Before you start

  • A project with a books collection — title (text, required), pages (number, required), in_stock (yes / no), genre. Create it in Cloud as in step 3 of the Quickstart.

  • A key and your project id in NORBIX_API_KEY and NORBIX_PROJECT_ID — see Install a Norbix SDK. The key needs a role that may write records, for example Data Editor.

Install

npm install @norbix.ai/ts

Create the client

import { Norbix, NorbixError } from '@norbix.ai/ts';

// Reads NORBIX_API_KEY and NORBIX_PROJECT_ID from the environment.
const norbix = new Norbix();

norbix.api is the data part (records, files, users), norbix.hub the configuration part (schemas, integrations, templates). To pass the values in code instead: new Norbix({ apiKey: 'nbsu_…', projectId: 'pr_…' }).

Write a record

A record goes in as a JSON string in document. The answer has the new record's id.

Read records

find returns one page of records in list.items. Add filter, sort or projection as in Search parameters.

Handle errors

A failed call throws a NorbixError with the gateway's code and message, the HTTP status, and every error in errors. Here the schema says pages is required:

The SDK has subclasses for the common cases: NorbixAuthError, NorbixValidationError, NorbixNetworkError and NorbixTimeoutError.

Run it

The output (the collection already had The Hobbit):

In TypeScript

Records come back as plain objects, so give them your own type. In quickstart.ts, the read loop becomes:

The rest of the file stays the same. It was checked with tsc --strict --skipLibCheck and run with node quickstart.ts (Node.js 24), with the same output.

Next steps

  • React app? Use React Redux — hooks with caching on top of this SDK.

  • Every operation, with a tab per language: SDK reference.

  • The same calls from the terminal: CLI.

Last updated