Installation
Basic Setup
Patterns
The SDK offers two ways to add tracing to your TypeScript/JavaScript code:Function Wrapping
UsewithSpan() to wrap function executions:
Decorators
Use the@span decorator for class methods:
Decorators require TypeScript configuration: Enable When using runtime tools like
experimentalDecorators in your tsconfig.json: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.