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 | int | No | 20 | 1–100 | Events per batch before sending |
flushIntervalSeconds | int | No | 30 | 1–3600 | Seconds between automatic flushes |
maxRetries | int | No | 3 | 1–10 | Retry attempts for failed requests |
sessionTimeoutMinutes | int | No | 30 | 1–10080 | Inactivity before a new session starts |
maxQueueSize | int | No | 1000 | 100–10000 | Max events held in queue |
logLevel | LogLevel | No | LogLevel.off | off·error·warning·info·debug | Console log verbosity |
Values outside the allowed range are clamped automatically.
appIdentifier Format
appIdentifier must be lowercase snake_case: only a-z, 0-9 and _ are allowed; it must start with a letter; it cannot contain spaces, hyphens, uppercase letters, non-ASCII characters, consecutive __, or a leading/trailing _.
| Valid | Invalid |
|---|---|
my_app | MyApp (uppercase) |
my_app_v2 | my-app (hyphen) |
checkout_web | my app (space) |
app123 | şirket (non-ASCII) |
a_b_c | 123app (leading digit) |