VisitorDto

@Serializable(with = VisitorDto.Serializer::class)
data class VisitorDto(val id: String = "", val siteId: String = "", val email: String? = null, val name: String? = null, val phone: String? = null, val avatarUrl: String? = null, val externalId: String? = null, val customData: JsonObject = EmptyJsonObject, val locale: HatangLocale? = null, val identifiedAt: Instant? = null, val client: String = "app", val app: VisitorAppInfo? = null, val currentScreen: String? = null, val visits: Int = 1, val raw: JsonObject = EmptyJsonObject)

The visitor (this app's user as the site sees them).

Constructors

Link copied to clipboard
constructor(id: String = "", siteId: String = "", email: String? = null, name: String? = null, phone: String? = null, avatarUrl: String? = null, externalId: String? = null, customData: JsonObject = EmptyJsonObject, locale: HatangLocale? = null, identifiedAt: Instant? = null, client: String = "app", app: VisitorAppInfo? = null, currentScreen: String? = null, visits: Int = 1, raw: JsonObject = EmptyJsonObject)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val app: VisitorAppInfo? = null

Registered app details for app visitors.

Link copied to clipboard
@SerialName(value = "avatar_url")
val avatarUrl: String? = null

Avatar URL.

Link copied to clipboard

web or app.

Link copied to clipboard
@SerialName(value = "current_screen")
val currentScreen: String? = null

The screen the app reported.

Link copied to clipboard
@Serializable(with = LenientObjectSerializer::class)
@SerialName(value = "custom_data")
val customData: JsonObject

Custom data (from identify / setData).

Link copied to clipboard
val email: String? = null

Known email.

Link copied to clipboard
@SerialName(value = "external_id")
val externalId: String? = null

The host app's user id (from identify).

Link copied to clipboard
val id: String

Visitor id.

Link copied to clipboard
@Serializable(with = InstantOrNullSerializer::class)
@SerialName(value = "identified_at")
val identifiedAt: Instant? = null

When the visitor was identified.

Link copied to clipboard

Identified via identify (has an external id, email or phone).

Link copied to clipboard
val locale: HatangLocale? = null

Preferred locale.

Link copied to clipboard
val name: String? = null

Known name.

Link copied to clipboard
val phone: String? = null

Known phone.

Link copied to clipboard
@Transient
val raw: JsonObject

The full wire payload.

Link copied to clipboard
@SerialName(value = "site_id")
val siteId: String

Site id.

Link copied to clipboard
val visits: Int = 1

Number of visits.

Functions

Link copied to clipboard
fun toJson(): JsonObject

The wire shape (unknown fields from raw kept).