NovantClient
NovantClient is the main entry point for the Novant API.
Create a single instance with your API key and reuse it across
calls:
import { NovantClient } from "@novant/sdk";
const client = new NovantClient({ apiKey: "ak_xxx" });Options
| Option | Default | Description |
|---|---|---|
apiKey |
— | Your Novant project or organization API key (required) |
projId |
— | Default project ID for project methods |
timeout |
30000 |
Request timeout in milliseconds |
baseUrl |
https://api.novant.io/v1 |
API base URL |
fetch |
globalThis.fetch |
Custom fetch implementation |
apiKey may be a project key (ak_xxx) or an
organization key (ak_org_xxx). An organization key must
name a project for every call to a project method, either with a default
projId here or with proj_id per call. See Organization.
Client options use JavaScript camelCase naming, while
method options use the API’s snake_case names.
Example
// Default timeout
const client = new NovantClient({ apiKey: "ak_xxx" });
// Custom timeout
const client = new NovantClient({ apiKey: "ak_xxx", timeout: 60000 });
// Organization key with a default project
const client = new NovantClient({ apiKey: "ak_org_xxx", projId: 4821 });Notes
Read your API key from the environment or a secrets manager rather than hardcoding it:
const client = new NovantClient({ apiKey: process.env.NOVANT_API_KEY });