Quick Start
Installation
Install the Novant JavaScript library using npm:
npm install @novant/sdkThe library requires Node.js 18 or later, and also runs on Bun, Deno, and serverless platforms. It ships ESM and CommonJS builds with TypeScript types included, and has no runtime dependencies.
This library is for server-side use only. API keys are secrets — never ship an API key to a browser.
Basic Usage
Once installed, create a NovantClient with your API key
to start querying your project. The example below covers the most common
operations:
import { NovantClient } from "@novant/sdk";
const client = new NovantClient({ apiKey: "ak_xxx" });
// Get project info
const proj = await client.project();
console.log(proj.city); // "Richmond, VA"
console.log(proj.tz); // "New_York"
// List assets
const { assets } = await client.assets();
for (const asset of assets) {
console.log(asset.name, asset.type);
}
// Read current values
const { values } = await client.values({ source_id: "s.2" });
for (const v of values) {
console.log(v.id, v.val, v.status);
}
// Get trend data
const { trends } = await client.trends({
point_ids: ["s.2.4", "s.2.5"],
date: "2026-03-09",
});
for (const row of trends) {
console.log(row.ts, row["s.2.4"], row["s.2.5"]);
}CommonJS is also supported:
const { NovantClient } = require("@novant/sdk");