Overview
The Anyway JS SDK provides functions and decorators to structure your traces:withWorkflow- High-level operations that orchestrate multiple taskswithTask- Individual units of work (like LLM calls)withAgent- Agent operations with automatic agent name propagationwithTool- Tool executions within agents
Basic Setup
withWorkflow and withTask
UsewithWorkflow for top-level operations and withTask for individual steps:
- OpenAI
- Anthropic
Class Decorators
For TypeScript projects withexperimentalDecorators enabled:
Agent Tracing
UsewithAgent to trace agent operations. Agent names automatically propagate to all child spans:
Association Properties
Attach metadata to traces for filtering and grouping in the dashboard:Conversation Tracking
Track multi-turn conversations:View in Dashboard
After running your code, view traces in the Anyway Dashboard:- Navigate to Traces
- Find your workflow trace
- Expand to see nested task spans
- View timing, inputs, and outputs for each operation
Next Steps
Configuration
Configure endpoints and authentication
Customer & Order Attribution
Link traces to customers and orders
Cost Tracking
Monitor your AI spend