Skip to main content
This page summarizes the primary SDK APIs. Use the feature guides for longer examples.

LynxTracer

LynxTracer records events, manages the active run context, and delivers event batches to Lynx.

lynx

lynx is a default tracer configured from environment variables.
Use this for simple applications. Use new LynxTracer() when you need explicit configuration per process, tenant, or test.

Run methods

run(agentName, callback)

Runs code inside a Lynx context.

run(options, callback)

Runs code with structured run metadata.

Managed prompts

getPrompt(id)

Returns the active immutable prompt by stable name or prompt UUID. Call it inside run() to pin the selected version and attach its versionId to related events.
The promise rejects when no valid runtime configuration is available or the prompt is not deployed for the API key environment and Agent scope.

initialize()

Loads managed prompts and firewall policies immediately. Concurrent calls share one request. Most applications can use runtimeConfig.enabled: true instead.

Semantic helpers

LLM and tool helpers

LLM options

Tool metadata

Delivery helpers

LynxPolicyError

firewallTool() throws LynxPolicyError when a tool call is blocked.

Configuration options