SDK overview
The Prefactor SDKs instrument your agent applications to record spans and send them to the Prefactor API. When your agent runs, the SDK captures LLM calls, tool invocations, and agent spans — along with their inputs, outputs, and token usage — and sends them as structured trace data. PREFACTOR_CAPTURE_INPUTS, PREFACTOR_CAPTURE_OUTPUTS, and PREFACTOR_SAMPLE_RATE control the data footprint; see Configuration and environment variables for defaults.
Both the TypeScript and Python SDKs follow the same model: you initialise the SDK with an integration package that matches your framework, and the shared configuration and schema options described in this section apply to both.
| Language | Links |
|---|---|
| TypeScript | Docs · Source · DeepWiki |
| Python | Docs · Source · DeepWiki |
Shared topics
Section titled “Shared topics”- Schemas and result schemas: how span payload schemas and result schemas are defined and when to override them
- Configuration and environment variables: runtime config, environment variables, transport settings, and retries
- CLI tool: command-line access for working with Prefactor from your terminal
Integrations
Section titled “Integrations”Available integration packages depend on the SDK:
- TypeScript includes packages for LangChain, the Vercel AI SDK, Claude, and other adapters in the TypeScript repo
- Python includes packages for LangChain and LiveKit in the Python repo