Skip to content

TypeScript SDK

The TypeScript SDK provides Logfire support for JavaScript and TypeScript applications across Node.js, browsers, Cloudflare Workers, and other OpenTelemetry-compatible runtimes.

Packages

  • logfire provides the runtime-agnostic manual tracing API: spans, logs, levels, error reporting, sampling helpers, evaluations, and managed variables.
  • @pydantic/logfire-node configures the OpenTelemetry Node SDK, exporters, automatic instrumentation, logs, metrics, and the logfire manual API.
  • @pydantic/logfire-browser configures browser tracing and re-exports the logfire manual API for client code.
  • @pydantic/logfire-cf-workers instruments Cloudflare Workers and forwards Worker spans to Logfire.

Where to start

Use Getting Started for a minimal script, then move to the package page for your runtime:

  • Server-side Node.js applications should start with Node.js.
  • Browser applications should start with Browser and use a restricted frontend application token for direct trace, metric, and session replay ingest.
  • Cloudflare Workers should start with Cloudflare Workers.
  • Framework users can use the Express, Next.js, Deno, or Vercel AI SDK guides.