Test mode: paid plans aren't on sale yet, so nothing is charged. Every plan's limits apply.

← Docs

Nod management API for TypeScript

A typed client for each realm's management API (<issuer>/api/v1). The types are generated from the API's OpenAPI description, so they match what the server serves.

import { Management, NodError } from "@nod/management";

const m = new Management({ issuer: "https://auth.example.com/acme", clientId: "ops", clientSecret: process.env.SECRET! });

const alice = await m.users.create({ username: "alice", email: "alice@example.com" });
await m.organizations.addMember("initech", alice.id!);
for await (const u of m.users.all()) console.log(u.username);            // follows the cursor for you
for await (const e of m.logs.all({ type: "signin.failure" })) alert(e);  // the security log, oldest first

try {
  await m.users.create({ username: "x" });
} catch (e) {
  if (e instanceof NodError) console.log(e.status, e.error, e.description);
}

Developing: npm ci, npm run generate after the API's description changes, npm test (builds Nod and runs the client against a real server on a throwaway PostgreSQL). Not published yet: publishing under a package name is a person's decision.