@withboundary/sdk when you need to answer production questions without reading application logs:
- Which contracts are rejecting most often?
- Which rule is causing retries?
- Did a prompt or model change reduce acceptance rate?
- Are failures isolated to one environment?
- Which runs need human review?
Install the SDK
@withboundary/sdk is separate from @withboundary/contract. Installing the local contract package never enables cloud telemetry by itself.
Add a Boundary logger
BOUNDARY_API_KEY is missing and no custom write sink is configured, createBoundaryLogger() returns null. Passing that to defineContract is safe. The contract still runs; it just sends no events.
Keep raw data off by default
The SDK’s defaults are conservative:Opt into raw payloads only when needed
Raw inputs and outputs are useful for staging or short debugging windows:Flush in short-lived runtimes
Long-running Node servers can rely on normal batching. Serverless and edge runtimes need an explicit flush near the end of the request:Node.js
Long-running processes
Next.js
Route handlers, server actions, and edge runtime
Vercel & Lambda
Per-invocation flushing
Workers & Edge
waitUntil and timer constraintsWhat to watch first
Start with a small dashboard checklist:- acceptance rate by contract
- top failing rules
- failures by category
- p95 duration and average attempt count
- recent rejected runs with repair messages
See also
SDK quickstart
Minimal hosted setup
Capture policy
Exact data buckets and defaults
Redaction
Scrub data before transmission
Security & data handling
Network behavior and trust boundaries