Configuration
The SDK uses a layered configuration system that prioritizes explicit options, falls back to environment variables, and auto-detects everything it can.Configuration Hierarchy
Environment Variables
Auto-Detection
Mode Detection
Mode is determined from the API key prefix:Environment Detection
The SDK checks these signals in order:ZENDFI_ENVIRONMENTenv varNODE_ENVvalue (production/staging/development)- Browser hostname (
localhost= development,.vercel.app= staging) - Falls back to
development
Safety Warnings
The SDK prints warnings for dangerous mode/environment mismatches:CLI Credentials
If you ranzendfi init, the SDK loads your key from ~/.zendfi/credentials.json: