Traceway
SDK

TypeScript SDK

Install and configure the Traceway TypeScript SDK.

The traceway npm package gives you two ways to send data to Traceway:

  1. Traceway client — programmatic control over traces and spans. You decide when spans start and end.
  2. traceway/ai subpath — automatic instrumentation for the Vercel AI SDK via OpenTelemetry. No manual span management.

Install

npm install traceway

If you're using the Vercel AI SDK integration, also install the OTel peer deps:

npm install traceway @opentelemetry/api @opentelemetry/sdk-trace-base

Configuration

Both the client and the AI integration read from the same sources, in this order:

  1. Constructor options
  2. Environment variables
OptionEnv varDefault
urlTRACEWAY_URLhttp://localhost:3000
apiKeyTRACEWAY_API_KEYnone
import { Traceway } from 'traceway';

// Explicit config
const tw = new Traceway({
  url: 'https://api.traceway.ai',
  apiKey: 'tw_sk_...',
});

// Or just set TRACEWAY_URL and TRACEWAY_API_KEY in your env
const tw2 = new Traceway();

Package exports

The package has two entry points:

Import pathWhat you get
tracewayTraceway client class, all types
traceway/aiinitTraceway(), TracewayExporter, mapper utilities
// Main client
import { Traceway } from 'traceway';

// Vercel AI SDK integration
import { initTraceway } from 'traceway/ai';

Next steps

On this page