Umami

class Umami(website: Uuid, enableEventQueue: Boolean = true, umamiOptions: UmamiOptionsBuilder.() -> Unit = {})

The main entry point for the Umami analytics library. This class is responsible for initializing the Umami configuration and managing the event queue.

Parameters

enableEventQueue

A flag to enable or disable the event queue.

umamiOptions

A builder for configuring Umami options.

See also

This is an internal API and may be changed in the future.

Constructors

Link copied to clipboard
constructor(website: Uuid, enableEventQueue: Boolean = true, umamiOptions: UmamiOptionsBuilder.() -> Unit = {})
constructor(website: String, umamiOptions: UmamiOptionsBuilder.() -> Unit = {})

Creates an Umami instance.

constructor(website: Uuid, umamiOptions: UmamiOptionsBuilder.() -> Unit = {})

Creates an Umami instance.

Properties

Link copied to clipboard

Provides convenient, internal access to the suspendable map of custom HTTP headers.

Link copied to clipboard
val httpClient: HttpClient

An HTTP client for making requests to the Umami API. This client is created lazily to ensure it is initialized only when needed.

Link copied to clipboard

Provides convenient, internal access to the configured UmamiLogger instance.

Functions

Link copied to clipboard
fun Umami.event(referrer: String? = null, title: String? = null, url: String? = null, name: String? = null, data: Map<String, Any?>? = null, tag: String? = null, timestamp: Long? = now(), id: String? = null)

Sends an event to the Umami API.

Link copied to clipboard
fun Umami.identify(data: Map<String, Any?>? = null, timestamp: Long? = now(), id: String? = null)

Sends an event to identify the user on the Umami server.