Skip to main content
Configuration resolves in strict precedence: constructor option > environment variable > default. There is nothing you must configure beyond the API key.
Invalid configuration never throws. The SDK warns (once, rate-limited) and disables itself — fail-open extends to misconfiguration, so a bad env var can’t take your agent down.

Options

The zero-config path

With only GLASSRAY_API_KEY set, new Glassray() sends to the hosted endpoint with content capture on, scrubbing on, and full sampling:

Endpoint override

Point the SDK at a self-hosted Glassray by setting the app origin — the SDK derives the traces path itself:
A full OTLP traces URL (ending in /v1/traces) is used verbatim.

Lifecycle

Three methods manage the transport — you only need them on serverless (see Reliability & serverless):