Skip to main content

Configuration

burn0 is configured via environment variables. No config files needed for basic usage.

Environment variables

VariableRequiredDefaultDescription
BURN0_API_KEYNoAPI key for cloud mode. Get one at burn0.dev.
BURN0_API_URLNohttps://api.burn0.devOverride the backend URL (for self-hosting or development).
BURN0_DEBUGNofalseSet to 1 to enable debug logging.
BURN0_ENABLE_TESTNoSet to 1 to enable tracking in NODE_ENV=test.

Runtime modes

burn0 automatically detects the right mode based on your environment:
ModeWhenBehavior
dev-localTTY + no API keyTicker in terminal, local ledger, no cloud sync
dev-cloudTTY + API keyTicker in terminal, local ledger, cloud sync
prod-cloudNo TTY + API keySilent, cloud sync only
prod-localNo TTY + no API keyLogs warning, skips tracking entirely
test-disabledNODE_ENV=testNo tracking (default in tests)
test-enabledNODE_ENV=test + BURN0_ENABLE_TEST=1Full tracking in tests

Local storage

burn0 stores data locally in the .burn0/ directory:
FilePurpose
.burn0/config.jsonProject config (services, plans)
.burn0/costs.jsonlEvent ledger (last 7 days)
.burn0/pricing-cache.jsonCached pricing data (24h TTL)
Add .burn0/ to your .gitignoreburn0 init does this automatically.

Disabling burn0

To temporarily disable burn0 without removing the import:
# In tests (default behavior)
NODE_ENV=test npm test

# In production without API key
# burn0 automatically skips patching and logs a warning

Restoring original behavior

To programmatically unpatch fetch and http:
import { restore } from '@burn0/burn0'

restore()  // Removes all burn0 patches