@usenaive-sdk/node
v0.12.1
Published
Legacy Naïve SDK (flat resource API). Superseded by @usenaive-sdk/server — install that for the governed-agent-profile surface (provision/tools/revoke). This package remains as a backward-compatible base and re-export target.
Readme
@usenaive-sdk/node (legacy)
Superseded by
@usenaive-sdk/server. New projects should install@usenaive-sdk/server, which re-exports everything here and adds the governed agent profile surface (forUser(id).provision(template),agentProfile.tools(),agentProfile.revoke(),runtime(pool).start()).
This package remains published for backward compatibility and is the base client
that @usenaive-sdk/server builds on. The flat resource API is unchanged:
import { Naive } from "@usenaive-sdk/node";
const naive = new Naive({ apiKey: process.env.NAIVE_SECRET_KEY });
await naive.cards.create({ spending_limit_cents: 25000 });
await naive.forUser(alice.id).cards.create({ spending_limit_cents: 25000 });Migration
- import { Naive } from "@usenaive-sdk/node";
+ import { Naive } from "@usenaive-sdk/server";Then you gain the agent profile layer:
const agentProfile = await naive.forUser(tenant.id).provision("sdr", { idempotencyKey: `ap:${tenant.id}` });
const tools = await agentProfile.tools();
await agentProfile.revoke();