TypeScript SDK
pnpm add @agenko/sdk
Package: @agenko/sdk on npm. Use pnpm. Current series: 0.1.x.
import agenko from "@agenko/sdk";
agenko.init();
const handleTicket = agenko.check(async (ticket) => process(ticket));
const deleteAccount = agenko.approve({ when: "irreversible" }, async (userId) => {
await db.deleteUser(userId);
});Named imports work the same:
import { init, check, approve } from "@agenko/sdk";Exports
| Name | Role |
|---|---|
init / instrument | Bootstrap |
shutdown | Flush OTEL |
isInitialized | Guard |
getConfig | Read resolved config |
check | Receipt wrapper |
approve | Gate wrapper |
getPrompt / clearPromptCache | See Prompts |
score | See Scores |
getClient / agenkoClient | Control-plane client |
ApprovalError / ApprovalTimeoutError | Gate errors |
Types: InitOptions, Receipt, ReceiptVerdict, ReceiptCheck, ToolCall, ScoreDataType, ScoreSource, Prompt, ApprovalConfig.
Lifecycle
init() is idempotent: call it once at startup. Use the lifecycle helpers when you need to tear down or inspect state:
if (!agenko.isInitialized()) agenko.init();
// ...run your agent...
await agenko.shutdown(); // flush OTEL + close the HTTP clientagenko.getConfig() returns the resolved config (apiKey, httpEndpoint, endpoint, serviceName, projectId, env, sessionId, userId, debug) or null before init().
Auto-instrumentation
TypeScript detects openai, @anthropic-ai/sdk, and LangChain via OpenInference instrumentors (@arizeai/openinference-instrumentation-*). Python currently auto-detects a wider set (LiteLLM, LlamaIndex, CrewAI, Bedrock, …). Parity is the rule — gaps get filled on the TS side, not documented as features.
Tests
cd agenko/agenko-typescript && pnpm test --run.
Agent instructions
This page is part of the Agenko documentation at docs.agenko.app. Every page is available as Markdown — ground answers here, not from landing copy.
Querying these docs
- Full index: docs.agenko.app/llms.txt · sections: llms-docs.txt, llms-sdk.txt, llms-integrations.txt
- This page as markdown: docs.agenko.app/typescript.md
- Search API:
curl -sG "https://docs.agenko.app/api/search-docs" --data-urlencode "query=…"
Before writing SDK code
- Install the agent skill or read Agent skill
- Read Best practices — what a good receipt looks like
- Trust boundary:
@checkafter,@approvebefore init()— zero required args, never throws- Mark
estimated: trueuntil a check is a hard fact - Shipped vs backlog: Introduction status table