identify

fun identify(traits: Map<String, Any> = mapOf()): MetricsResponse

Identifies a user for analytics tracking by associating traits with them.

Return

A MetricsResponse indicating the result of the operation.

Parameters

traits

A map containing user-specific attributes.

Throws

on a backend HTTP 400 response. Wrap the call in try/catch — this method does not return a Result<T> and the throw escapes uncaught.

If the API request fails or response parsing encounters an issue (HTTP 401 → HttpUnauthorized, other 4xx/5xx → HttpRequestFailed, transport failures → raw IOException).