Skip to content

Commit f47951a

Browse files
committed
RUM-10247: Update setUserInfo and setAccountInfo documentation
1 parent 03ab092 commit f47951a

File tree

1 file changed

+16
-5
lines changed
  • dd-sdk-android-core/src/main/kotlin/com/datadog/android

1 file changed

+16
-5
lines changed

dd-sdk-android-core/src/main/kotlin/com/datadog/android/Datadog.kt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package com.datadog.android
99
import android.content.Context
1010
import androidx.annotation.AnyThread
1111
import androidx.annotation.WorkerThread
12+
import com.datadog.android.Datadog.clearAccountInfo
1213
import com.datadog.android.api.InternalLogger
1314
import com.datadog.android.api.SdkCore
1415
import com.datadog.android.api.context.UserInfo
@@ -260,7 +261,10 @@ object Datadog {
260261
}
261262

262263
/**
263-
* Sets the user information.
264+
* Sets the information used to identify a real user.
265+
*
266+
* This API should be used to assign a stable identifier for the user, such as a user ID,
267+
* email, or username. The information set here will be added to logs, traces and RUM events.
264268
*
265269
* @param id (nullable) a unique user identifier (relevant to your business domain)
266270
* @param name (nullable) the user name or alias
@@ -315,9 +319,14 @@ object Datadog {
315319
}
316320

317321
/**
318-
* Sets current account information.
322+
* Sets the account information that the user is currently logged into.
323+
*
324+
* This API should be used to assign an identifier for the user's account which represents a
325+
* contextual identity within the app, typically tied to business or tenant logic. The
326+
* information set here will be added to logs, traces and RUM events.
319327
*
320-
* Those will be added to logs, traces and RUM events automatically.
328+
* This value should be set when user logs in with his account, and cleared by calling
329+
* [clearAccountInfo] when he logs out.
321330
*
322331
* @param id Account ID.
323332
* @param name representing the account, if exists.
@@ -340,7 +349,8 @@ object Datadog {
340349
)
341350
}
342351

343-
/** Add custom attributes to the current account information
352+
/**
353+
* Add custom attributes to the current account information.
344354
*
345355
* This extra info will be added to already existing extra info that is added
346356
* to Logs, Traces and RUM events automatically.
@@ -358,7 +368,8 @@ object Datadog {
358368
sdkCore.addAccountExtraInfo(extraInfo)
359369
}
360370

361-
/** Clear the current account information
371+
/**
372+
* Clear the current account information.
362373
*
363374
* Account information will set to null
364375
* Following Logs, Traces, RUM Events will not include the account information anymore.

0 commit comments

Comments
 (0)