Source and issues
- Source: github.com/trulayer/client-typescript
- Issues / bug reports: github.com/trulayer/client-typescript/issues
- Package:
@trulayer/sdkon npm
TruLayer class
The main client. Import and construct once per app.
Methods
trace()
fn becomes the return value of trace(). Exceptions are captured onto the trace as errors, then re-thrown.
TraceContext
Passed to the trace() callback.
span()
SpanContext
Instrumentation helpers
instrumentOpenAI(client, tl?)
chat.completions.create and embeddings.create call becomes a span automatically.
instrumentAnthropic(client, tl?)
instrumentVercelAI(tl?)
Module-level helpers
init() / getClient()
If you prefer a global pattern over passing tl explicitly: