Environment variables
Constructor values override these:
| Variable | Purpose |
|---|---|
| ROLLOUT_API_KEY | Workspace API key |
| ROLLOUT_BASE_URL | Ingest endpoint override |
| ROLLOUT_ENVIRONMENT | Deployment environment, e.g. production |
| ROLLOUT_RELEASE | App version or git SHA |
| ROLLOUT_SERVICE_NAME | Service identifier |
| ROLLOUT_AGENT_NAME | Agent name |
| ROLLOUT_AGENT_ID | Agent ID |
| ROLLOUT_AGENT_VERSION | Agent version |
| ROLLOUT_DEPLOYMENT | Deployment slot or region |
| ROLLOUT_SAMPLE_RATE | Trace sample rate (0.0–1.0) |
| ROLLOUT_DEBUG | Verbose logging (true/false) |
| ROLLOUT_DISABLED | Disable the SDK entirely (true/false) |
Useful local options
config.ts
const rollout = new Rollout({ apiKey: "rl_...", syncMode: true, // send inline; tests / debugging only debug: true, beforeSend(event) { return event.event_type === "debug.noise" ? null : event; }, scrubber(event) { return event; },});Tip
syncMode: true sends events inline in the calling thread, which makes tests deterministic. Leave it off in production so the background batcher does the work.
scrubber & beforeSend
Both hooks run before an event is enqueued, and scrubber runs before beforeSend. Use scrubber to redact or strip fields on every event, and beforeSend to mutate an event or return null to drop it. The equivalent Python pipeline and PII defaults are documented under Privacy & redaction.