Skip to main content

API Reference

MethodDescription
B2Metric.init(config): Promise<void>Initialize the SDK. Must be called before any other method.
B2Metric.logEvent(name, options?): voidTrack a custom event.
B2Metric.setUser(user): voidIdentify the current user and update their profile.
B2Metric.registerPushToken(token, provider): voidRegister a push notification token.
B2Metric.trackPushOpened(data): voidTrack a push notification open.
B2Metric.flush(): Promise<void>Send all pending events immediately.
B2Metric.destroy(): Promise<void>Flush pending events and shut down the SDK.