Skip to main content
The ZeroEval TypeScript SDK provides tracing for Node.js applications through wrapper functions and integration callbacks.

Installation

Basic Setup

Need source-side PII redaction? Pass redaction: { enabled: true } to init(...) or set ZEROEVAL_REDACT_PII=true. See PII redaction.

Patterns

The SDK offers two ways to add tracing to your TypeScript/JavaScript code:

Function Wrapping

Use withSpan() to wrap function executions:

Decorators

Use the @span decorator for class methods:
Decorators require TypeScript configuration: Enable experimentalDecorators in your tsconfig.json:
When using runtime tools like tsx or ts-node, pass the --experimental-decorators flag.

Sessions

Sessions group related spans together for tracking workflows, user interactions, or multi-step processes.

Basic Session

Multi-Step Pipeline

Context

Access current context information:

Tagging

Attach tags for filtering and organization:

Feedback

To attach human or programmatic feedback to completions, see Human Feedback and the Feedback SDK docs. For automated quality evaluations, see Judges.

Advanced Configuration

Fine-tune the SDK behavior:
Need help? Check out our GitHub examples or reach out on Discord.