When to use this
Read this page before using the SDK in production, serverless functions, workers, or request paths where event delivery should not block user traffic.How it works
The SDK keeps events in memory and sends them in batches. Delivery runs in the background by default. If delivery fails, events move to a retry buffer and the SDK backs off. After repeated failures, the circuit breaker opens and pauses delivery attempts for a cooldown period.Production defaults
Background delivery
In background mode,run() records events locally and returns without waiting for event delivery.
- The background flush timer
- An explicit
flush()call - A
shutdown()call
Blocking mode
UseBLOCKING mode only when the current process should attempt delivery during the request lifecycle.
Flush and shutdown
Useflush() when you want to send the current queue and keep using the SDK.
shutdown() before a process exits or at the end of a serverless handler when you want a best-effort final send.
Local status
UsegetStatus() to inspect local SDK delivery state.
If the Lynx API is unavailable
Your service keeps running by default. The SDK:- Catches network, timeout, and non-2xx response errors
- Moves failed batches into an in-memory retry queue
- Uses backoff before retrying
- Opens the circuit breaker after repeated failures
- Drops events according to
overflowStrategywhen the queue is full
Notes
Events are stored in memory, not on disk. If the process exits before events are sent, unsent events may be lost. Useshutdown() when graceful exit matters.
Firewall decisions run locally. The Lynx API being unavailable does not decide whether a protected tool call is allowed or blocked.