AnalyticsClient

interface AnalyticsClient

Provider-agnostic analytics client interface. Apps implement (or bridge) this against whatever analytics SDK they use (Firebase, Amplitude, PostHog, etc.); the shared library only depends on this interface, never a concrete provider.

Inheritors

Functions

Link copied to clipboard
abstract fun flush()

Flush pending events.

Link copied to clipboard
abstract fun identify(userId: String)

Identify a user with a unique ID.

Link copied to clipboard
abstract fun increment(property: String, value: Double)

Increment a numeric user property.

Link copied to clipboard
abstract fun initialize(token: String, serverUrl: String? = null)

Initialize the analytics SDK.

Link copied to clipboard
abstract fun reset()

Reset user identity (logout).

Link copied to clipboard
abstract fun setUserProperties(properties: Map<String, Any>)

Set user properties.

Link copied to clipboard
abstract fun track(event: AnalyticsEvent)

Track an event with optional properties.

Link copied to clipboard
abstract fun trackScreen(name: String, properties: Map<String, Any> = emptyMap())

Track a screen view.