TypeScript SDK — Authentication
API key and agent key handling in the TypeScript SDK.
The SDK sends Authorization: Bearer <apiKey> on every request. An optional x-korclaw-client header identifies the SDK version.
typescript
// Agent key for policy/runtime endpoints
const result = await korclaw.policies.evaluate({
input: { action: "deploy", agent: "ops-bot" },
agentKey: process.env.KORCLAW_AGENT_KEY,
});Constructor throws if apiKey is missing. Never hardcode keys in source code.