Novant

Documentation

Sign in

Overview

NovantClient

All interaction with the Novant API goes through a single NovantClient instance. Create one with your API key and reuse it across calls:

import { NovantClient } from "@novant/sdk";

const client = new NovantClient({ apiKey: "ak_xxx" });

Every method is async and returns a Promise.

Plain Objects

Methods return the API’s JSON response as a plain object, exactly as documented in the API Reference. Fields keep the API’s snake_case names, and the library exports a TypeScript type for every response:

const res = await client.assets();

console.log(res.proj_id);         // 4821
console.log(res.assets.length);   // number of assets

for (const asset of res.assets) {
  console.log(asset.name);
}

Optional fields are omitted from the response when they have no value, so check for undefined before using them. New fields added to the API appear in results without a library update.

The one exception is point props: the API returns them as top-level keys on each point, and the library moves them into a nested props object. See Points.

To look up a single item by ID, use standard array methods:

const { assets } = await client.assets();
const ahu = assets.find((a) => a.id === "a.1");

Options

Method options use the same snake_case names as the API arguments, so the API Reference applies directly. Lists are passed as arrays:

await client.points({
  space_id: "sp.1",
  point_types: ["zone_air_temp_sensor"],
});

Methods with a required argument take it first, followed by an options object, for example write(point_id, value, opts).

Point IDs

Points in Novant are addressed using a dotted ID scheme. A point ID like s.2.4 refers to source 2, point 4. Source IDs (s.2) and point IDs (s.2.4) are used throughout the API to scope queries:

// Read values for all points on source s.2
await client.values({ source_id: "s.2" });

// Read trends for specific points
await client.trends({ point_ids: ["s.2.4", "s.2.5"], date: "2026-03-09" });

Project IDs

Every project method accepts an optional proj_id option naming the project to act on. A project key does not need proj_id, since the key is bound to its project. An organization key requires proj_id on every project method, either per call or as a default on the client:

const client = new NovantClient({ apiKey: "ak_org_xxx" });
await client.zones({ proj_id: 4821 });

For more on organization keys, see Organization.

TypeScript

Response and option types are exported from the package:

import { NovantClient, type Point, type ValueList } from "@novant/sdk";

const res: ValueList = await client.values({ source_id: "s.2" });