Skip to main content
For agents you build yourself in TypeScript or JavaScript — autonomous bots, trading agents, ElizaOS characters, Solana Agent Kit flows — import the SDK and call voight.log() directly. Library mode is provider-agnostic — wrap any LLM call (OpenAI / Anthropic / GLM / Mistral / your-own-proxy) and emit the event yourself. The backend MODEL_PRICING table ships entries for the major providers, so cost / token attribution lights up automatically as long as you set model on the event.

Install

Requirements:
  • Node.js 18+ (uses global fetch)
  • Bun, Deno, browsers, and Cloudflare Workers all supported

Quick start

Returns { ok: true, eventId, agentId } on success, { ok: false, error: { code, message } } on failure.

Constructor options

The log() method

All fields optional. The server normalises and defaults type: 'decision' if you don’t pass one. Retry behaviour:
  • 3 attempts by default
  • Exponential backoff
  • Respects Retry-After header on 429s
  • Swallowed by default (swallowErrors: true) — recommended for production agents that shouldn’t crash on observability failures

Examples

Trading bot

ElizaOS character (skill plugin)

A native ElizaOS plugin (@voightxyz/eliza-skill) is on the roadmap and will simplify this to one line.

LangChain / LangGraph agent

Error types

When swallowErrors: false, these throw. Otherwise they return as { ok: false, error }.

Privacy in library mode

By default, library callers send events as Full (no scrubbing). To opt into Standard scrubbing per-event:
The same 12 PII patterns + Luhn-validated card detection apply. See the PII patterns reference.

check() and enforce() — v1.0

Today these return { allow: true, reason: 'not-implemented' } so you can instrument call sites now and flip a flag later. Real implementation ships in v1.0.

Next

  • HTTP API — for runtimes that don’t use npm at all
  • POST /v1/events — full HTTP API schema for event ingestion