Skip to main content

Configuration

OptionTypeRequiredDefaultRangeDescription
apiKeyStringYesnonenon-blankYour B2Metric API key
appIdentifierStringYesnonesnake_caseRegistered app identifier, sent as user_properties.app_identifier
baseUrlStringNohttps://tracker.b2metric.comnon-blankEndpoint base; override only for test/staging
batchSizeIntNo201–100Events per batch, and per delivery request
flushIntervalSecondsLongNo301–3600Seconds between periodic flushes
maxRetriesIntNo31–10Failed passes after which a retry warning is logged
sessionTimeoutMinutesIntNo301–10080Inactivity window before a new session
maxQueueSizeIntNo1000100–10000Undelivered events kept on device; oldest evicted first
b2MetricAnalyticsLogLevelLogLevelNoOFFsee belowSDK log verbosity

maxRetries is diagnostic only: events are never dropped for retry exhaustion. An event leaves the queue when it is delivered, rejected by the API with a 4xx, or evicted by maxQueueSize.

Note

The config's toString() masks the API key (only a short prefix survives), so logging a config instance never leaks the credential.