@vouch-ai/sdk
v0.1.0
Published
Vouch SDK for TypeScript/Node. One init() call auto-instruments OpenAI, Anthropic, LangChain, Bedrock, and ships OTel spans to your Vouch project.
Maintainers
Readme
@vouch/sdk
Vouch SDK for TypeScript / Node. One init() call auto-instruments OpenAI, Anthropic, LangChain, Bedrock, and LlamaIndex via OpenLLMetry (traceloop) and ships every span to your Vouch project.
Install
npm install @vouch/sdk
# or pnpm add @vouch/sdk / yarn add @vouch/sdkQuickstart
import { vouch } from "@vouch/sdk";
vouch.init({
projectPk: process.env.VOUCH_PROJECT_PUBLIC_KEY!,
projectSk: process.env.VOUCH_PROJECT_SECRET_KEY!,
agentId: "prod-rag-bot", // optional — surfaces in dashboard
});
// Any LLM call after init() is auto-traced.
import OpenAI from "openai";
const openai = new OpenAI();
await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hi" }],
});That's the whole integration. The dashboard's connection panel flips to Connected the moment the first span lands.
What gets auto-instrumented
Any client traceloop supports:
openai(chat.completions.create, responses.create, embeddings)anthropic(messages.create)@anthropic-ai/bedrock-sdk,@aws-sdk/client-bedrock-runtime@langchain/*chains and graph nodesllamaindexcohere-ai,groq-sdk, and the rest of the OpenLLMetry surface
No per-call decoration needed.
Configuration
| Option | Env fallback | Default |
| --- | --- | --- |
| projectPk | VOUCH_PROJECT_PUBLIC_KEY / LANGFUSE_PUBLIC_KEY | — |
| projectSk | VOUCH_PROJECT_SECRET_KEY / LANGFUSE_SECRET_KEY | — |
| agentId | VOUCH_AGENT_ID | undefined |
| endpoint | VOUCH_ENDPOINT / LANGFUSE_HOST | https://app.tryvouch.ai |
| appName | — | agentId or "vouch-app" |
| disableBatch | — | false (batching on) |
| traceloopOptions | — | forwarded to Traceloop.initialize() verbatim |
init() is idempotent — repeat calls are no-ops.
Self-hosted Vouch
Point endpoint at your self-hosted Vouch instance:
vouch.init({
projectPk: "...",
projectSk: "...",
endpoint: "https://vouch.internal.acme.com",
});The SDK appends /api/public/otel automatically.
Skip the SDK entirely
If you'd rather use raw OpenTelemetry (any language):
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://app.tryvouch.ai/api/public/otel/v1/traces"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Basic $(printf 'pk-vouch-...:sk-vouch-...' | base64)"Any OTel-instrumented service (Python, Go, Java, .NET) ships spans straight to Vouch with zero custom code.
License
MIT.
