Getting started
Quickstart
Create a versioned Agent, run a Turn, and stream its durable progress with the TypeScript SDK.
1. Create an App and keys
Create an App in the nvoken console, issue an App key, and register the provider key for the model you intend to use. Copy the App's API base URL.
export NVOKEN_BASE_URL='<your nvoken API base URL>'
export NVOKEN_API_KEY='<your App API key>'2. Install the SDK
npm install @deepnoodle/nvoken@^0.32.03. Create and run an Agent
import { Client } from "@deepnoodle/nvoken";
const client = new Client();
const agent = await client.agents.create({
key: "quickstart",
name: "Quickstart",
instructions: "Be concise and helpful.",
model: "anthropic/claude-sonnet-5",
});
const result = await agent.run("Say hello in one short sentence.", {
tenant: "quickstart",
user: "developer",
});
console.log(result.text);
console.log(result.turn.id, result.status);App ownership is the Agent default, so this one Agent can serve every tenant. Every Turn still states its tenant and optional actor explicitly.
4. Stream a Turn
start() durably accepts work and returns a recoverable handle. updates()
follows the Turn until it ends:
const agent = await client.agent("quickstart");
const turn = await agent.start("Write a two-line welcome.", {
tenant: "quickstart",
idempotencyKey: "welcome-v1",
});
for await (const update of turn.updates()) {
console.log(update.snapshot.status, update.snapshot.text);
}If your process exits after the Turn is accepted, reconstruct the same handle from the stored ID:
const recovered = client.turn(turn.id, { tenant: "quickstart" });
const final = await recovered.result();A local timeout or disconnected stream does not cancel remote work.
5. Add Conversation continuity when you need it
const chat = agent.conversation({
tenant: "quickstart",
key: "demo-thread",
owner: "tenant",
});
await chat.text("Remember that the release color is indigo.");
console.log(await chat.text("What is the release color?"));The Conversation supplies transcript continuity only. Choose memory separately
with the memory option, or omit it.