Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Solo and multi-tenant flows with the SDK.
users.create()
import { Naive } from "@usenaive-sdk/node"; const naive = new Naive({ apiKey: process.env.NAIVE_API_KEY! }); await naive.cards.create({ spending_limit_cents: 25000 }); await naive.email.createInbox(); await naive.vault.put("instantly.api_key", "key_xyz"); const { redirectUrl } = await naive.connections.connect("gmail", { callbackUrl });
const alice = await naive.users.create({ external_id: dbUser.id, email: dbUser.email, }); const client = naive.forUser(alice.id); await client.cards.create({ spending_limit_cents: 25000 }); const { redirectUrl } = await client.connections.connect("gmail", { callbackUrl }); res.redirect(redirectUrl!); // Hand a per-user MCP session to your agent const session = await client.session(); console.log(session.mcp.url, session.mcp.headers);
const pro = await naive.accountKits.create({ name: "Pro", connections_config: { mode: "allowlist", toolkits: ["gmail", "slack", "stripe"] }, }); await naive.accountKits.assignUser(pro.id, alice.id);