@open-nodo/sdk
v0.1.3
Published
Reference instance-side client for the Nodo rail: keypair + one-time registration, signed check-in scheduler, local entitlement enforcement with offline grace.
Readme
@open-nodo/sdk
Reference client every Nodo instance embeds to talk to the rail.
What it does (per the check-in protocol):
- Keypair + registration (1.5.1) — generates an Ed25519 keypair on first boot, stores the private
key via the host's
KeyStore, and registers once with a one-time registration token →instance_id. - Check-in scheduler (1.5.2) — on boot and on an interval, builds a JWT
{ iss, iat, jti }, signs it (EdDSA), posts it, and caches the response. - Local enforcement (1.5.3) —
isModuleEnabled(key)reads the cached entitlements so the module loader can gate UI without a round-trip. - Offline grace (1.5.4) — if the rail is unreachable, keeps the last-known entitlements for the grace window, then degrades.
import { createNodoInstance } from "@open-nodo/sdk";
const nodo = createNodoInstance({ railUrl: "https://api.nodo.dev/v1", storage: myKeyStore });
await nodo.registerOnce(process.env.NODO_REGISTRATION_TOKEN!, { kind: "self" });
nodo.start(); // boot + scheduled check-ins
if (nodo.isModuleEnabled("accounting")) { /* mount accounting */ }Self-service instances from the /join catalog register with a one-time selection token instead — same endpoint, same idempotency:
await nodo.registerWithSelectionToken(process.env.NODO_SELECTION_TOKEN!, { orgName: "Acme" });License: Apache-2.0. Types come from @open-nodo/protocol.
