Configuration
| Option | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
apiKey | string | Yes | — | — | Your B2Metric API key |
appIdentifier | string | Yes | — | snake_case | Identifier of your app registered in B2Metric |
baseUrl | string | No | https://tracker.b2metric.com | — | API endpoint URL |
batchSize | number | No | 20 | 1–100 | Events per batch before sending |
flushIntervalSeconds | number | No | 30 | 1–3600 | Seconds between automatic flushes |
maxRetries | number | No | 3 | 1–10 | Retry attempts for failed requests |
sessionTimeoutMinutes | number | No | 30 | 1–10080 | Inactivity before a new session starts |
maxQueueSize | number | No | 1000 | 100–10000 | Max events held in queue |
logLevel | string | No | "off" | off·error·warning·info·debug | Console log verbosity |
appIdentifier Format
Must be lowercase snake_case: only a-z, 0-9 and _; must start with a letter; cannot contain spaces, hyphens, uppercase, non-ASCII characters, consecutive __, or leading/trailing _.