Skip to content

SdkCore

Xavier F. Gouchet edited this page Sep 4, 2024 · 1 revision

interface SdkCore

SdkCore is the entry point to register Datadog features to the core registry.

Inheritors

FeatureSdkCore

Properties

name

abstract val name: String

Name of the current SDK instance.

service

abstract val service: String

Name of the service (given during the SDK initialization, otherwise package name is used).

time

abstract val time: TimeInfo

The current time (both device and server).

Functions

addUserProperties

@AnyThread

abstract fun addUserProperties(extraInfo: Map<String, Any?>)

Sets additional information on the UserInfo object

If properties had originally been set with SdkCore.setUserInfo, they will be preserved. In the event of a conflict on key, the new property will prevail.

Parameters
extraInfo additional information. An extra information can be nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.

clearAllData

@AnyThread

abstract fun clearAllData()

Clears all unsent data in all registered features.

setTrackingConsent

@AnyThread

abstract fun setTrackingConsent(consent: TrackingConsent)

Sets the tracking consent regarding the data collection for this instance of the Datadog SDK.

Parameters
consent which can take one of the values (TrackingConsent.PENDING, TrackingConsent.GRANTED, TrackingConsent.NOT_GRANTED)

setUserInfo

@AnyThread

abstract fun setUserInfo(id: String? = null, name: String? = null, email: String? = null, extraInfo: Map<String, Any?> = emptyMap())

Sets the user information.

Parameters
id (nullable) a unique user identifier (relevant to your business domain)
name (nullable) the user name or alias
email (nullable) the user email
extraInfo additional information. An extra information can be nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.
Clone this wiki locally