@north-light/api
v0.3.447
Published
Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.
Keywords
Readme
@north-light/api — the typed client and contract for the crtrd /v1 API
@north-light/api is the low-level contract for the crouter daemon's /v1 HTTP API: the CrtrClient class, route builders, the API error type, request and response types (DTOs), and the schema for command-plugin manifests. It has no runtime dependencies and no install scripts.
It is not the package most applications want. @north-light/sdk is built on it and adds run management, streaming, typed results and OAuth. Use @north-light/api when you need the wire contract itself — a thin client, a proxy, or tooling that validates plugin manifests.
Docs · SDK resource map · crouter repository · Source
Install
npm install @north-light/apiThe package is ESM-only. Import it from an ES module, or use dynamic import() from CommonJS. A crouter daemon (npm install -g @north-light/cli) must be reachable for any request.
Connect to a daemon
CrtrClient is the typed HTTP client. Give it a TCP base URL and any required bearer header. crtr sys connect prints both for a local daemon.
import { CrtrClient } from '@north-light/api';
const client = new CrtrClient({
baseUrl: 'https://my-crtrd.example.com',
headers: { authorization: 'Bearer a-daemon-token' },
});
const nodes = await client.listNodes();
console.log(nodes.map((node) => node.node_id));For the local Unix socket, import the Node-only entry point:
import { localClient } from '@north-light/api/node';
const client = localClient();
console.log(await client.healthz());Exports
CrtrClientandwaitForDaemonAvailabilityfor typed/v1requests.routesandAPI_VERSIONfor route construction.LONG_POLL_ROUTES,longPollRouteandlongPollHoldSeconds— which daemon routes hold a request open (?wait=) and for how long, for a proxy that must not cut a held request off.ApiError,APIError,ErrorBodyandisErrorBodyfor the API error contract.- DTOs for canvas, nodes, reports, lifecycle, files, bash, memory, models, human requests, crons, reviews and related routes.
@north-light/api/node—defaultSocketPath,socketFetchandlocalClient.@north-light/api/plugin-manifestand@north-light/api/command-manifest— the plugin command-manifest schema and validation types.@north-light/api/cards— generated context types.
Related
@north-light/sdk— the client most applications should use.@north-light/plugin— author plugins whose manifests use this package's types.- Main repository — the
crtrCLI, thecrtrddaemon.
License
Proprietary. Copyright (c) 2026 Northlight Systems. All rights reserved. See LICENSE.
