Documentation Index
Fetch the complete documentation index at: https://docs.trulayer.ai/llms.txt
Use this file to discover all available pages before exploring further.
Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | TruLayer API key (tl_...) |
projectName | string | required | Human-readable project name |
projectId | string | — | Deprecated alias for projectName. Removed in 0.3.x. |
environment | string | "production" | Filter label |
endpoint | string | https://api.trulayer.ai | Override for self-hosted |
batchSize | number | 50 | Spans per flush |
flushInterval | number | 2000 | ms between flushes |
timeout | number | 5000 | HTTP timeout (ms) |
sampleRate | number | () => boolean | 1.0 | Fraction of traces to send |
redact | (value: unknown) => unknown | undefined | Redact inputs/outputs before ingest |
relayUrl | string | undefined | Server-side relay URL for browser builds |
debug | boolean | false | Log payloads locally |
Example — production
Example — offline/test
Sampling
Static fraction:Flush & shutdown
flush() before returning a response in serverless/Edge functions. Call shutdown() on SIGTERM in long-lived servers.