b2metric_sdk 1.1.0
b2metric_sdk: ^1.1.0 copied to clipboard
B2Metric analytics SDK for Flutter. Collects events, manages sessions, and supports push notifications on Android and iOS.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.1.0 - 2026-09-14 #
Added #
- A/B testing. Configure
experimentIdsto take part in experiments created in your B2Metric panel, then read the group this device was assigned to withgetExperimentGroupId(). Assignments are fetched when the SDK starts and at the beginning of each session, stored on the device, and read synchronously, so a variant is available during a build with no loading state to thread through the widget tree. experiments(aValueListenable) andexperimentChanges(a broadcastStream) for rebuilding when assignments change. Both carry the same snapshot; the SDK ships neither a provider nor anInheritedWidget, so it does not compete with the app's own state management.getExperimentAssignments()andrefreshExperiments().experimentsBaseUrlto point assignment requests at a test or staging environment.ExperimentAssignmentandExperimentsSnapshottype exports.
Notes #
- The experiments module stays off until
experimentIdsis set, so existing integrations are unaffected by upgrading. - Reads return
nullwhen the device is outside the experiment's audience, the experiment has ended, or the first refresh has not landed yet. Give every experiment a default. - Assignment follows the device rather than the signed-in user, so
setUsernever moves anyone between groups and a variant cannot change underneath someone at login. - Stored assignments are kept when a refresh fails or the device is offline.
1.0.0 - 2026-07-21 #
Changed #
- First stable release. The public API is now considered stable under semantic versioning. No functional changes since 0.4.0.
0.4.0 - 2026-06-21 #
Added #
B2Metric.setUser()to identify the current user and update their profile attributes. AcceptsuserId(required) plus optionalname,surname,email, and any custom attributes viaproperties.B2MetricUsertype export.
Changed #
- User attributes set via
setUserare merged into theuser_propertiesof subsequent events. Theuser_propertiesof each event is now a point-in-time snapshot, and device-collected fields always take precedence over custom attributes.
0.3.0 - 2026-06-02 #
Added #
- iOS Swift Package Manager (SPM) support, required for Flutter 3.44+ where SPM is the default iOS/macOS dependency manager. CocoaPods support is retained, so existing apps are unaffected.
0.2.0 - 2026-05-21 #
Added #
appIdentifierfield inB2MetricConfigto identify the app registered in B2Metric. Validated as lowercase snake_case (^[a-z][a-z0-9]*(_[a-z0-9]+)*$).app_identifieris now included in collected user properties.
Changed #
- BREAKING:
B2Metric.init()now requiresappIdentifierin addition toapiKey. Calls without it will throw at initialization.
0.1.0 - 2026-05-17 #
Added #
- Initial release of the B2Metric Flutter SDK.
- Custom event tracking with properties and item-level data.
- Automatic session management (
first_open,session_start,session_end). - Push notification token registration (FCM, HMS, APNS) and open tracking.
- Offline event queuing with persistent storage on SharedPreferences / UserDefaults.
- Automatic batching, retry with exponential backoff, and network-aware delivery.
- Automatic device and app metadata collection.
- Optional
onLogcallback to forward SDK logs to a custom sink. - Example testbed app under
example/.