Skip to main content

Configuration

OptionTypeRequiredDefaultRangeDescription
apiKeyStringYes——Your B2Metric API key
appIdentifierStringYes—snake_caseIdentifier of your app registered in B2Metric
baseUrlStringNohttps://tracker.b2metric.com—API endpoint URL
batchSizeintNo201–100Events per batch before sending
flushIntervalSecondsintNo301–3600Seconds between automatic flushes
maxRetriesintNo31–10Retry attempts for failed requests
sessionTimeoutMinutesintNo301–10080Inactivity before a new session starts
maxQueueSizeintNo1000100–10000Max events held in queue
logLevelLogLevelNoLogLevel.offoff·error·warning·info·debugConsole 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 _.

ValidInvalid
my_appMyApp (uppercase)
my_app_v2my-app (hyphen)
checkout_webmy app (space)
app123şirket (non-ASCII)
a_b_c123app (leading digit)