Skip to main content

User & session data

This page documents the Bugsee Android SDK 7.0.0. For the previous major version, see Adding custom data.

Annotate every report with facts about the current user and session: arbitrary key/value attributes, and a stable user identifier. Both live on the Bugsee facade and are safe to call before or after Bugsee.launch(...).

User and session attributes

Arbitrary key/value attributes can be attached to the report. Issues are searchable by these attributes in the Bugsee dashboard. Attributes persist across sessions until the application is uninstalled or the SDK's storage is cleared.

warning

Each attribute has a limit of 1 kB and the total size of all attributes must not exceed 25 kB.

Bugsee.setAttribute("name", "John Doe");
Bugsee.setAttribute("age", 23);
Bugsee.setAttribute("married", false);

Attributes can be removed individually or all at once:

// Clear a single attribute by name
Bugsee.clearAttribute("name");

// ...or clear all of them
Bugsee.clearAllAttributes();

Attributes can also be read back. Bugsee.getAttribute(name) returns a single value (or null if unset); Bugsee.getAllAttributes() returns a Map<String, Serializable> snapshot of every attribute (or null if none are set).

Object age = Bugsee.getAttribute("age"); // null if unset
Map<String, Serializable> all = Bugsee.getAllAttributes(); // null if empty

User identity

New in 7.0.0

Bugsee provides a dedicated user identity API.

The user identifier is a stable string (such as your backend user ID, an email, or a UUID) that correlates every session and issue for a given user. It is distinct from arbitrary attributes: the identifier is a first-class field on every report and is surfaced prominently in the Bugsee dashboard. Use attributes for additional facts about the user or session; use the identifier for who the user is.

// Set the identifier once the user has signed in
Bugsee.setUserIdentifier("user-123");

// Read back the currently-set identifier (null if none)
String currentId = Bugsee.getUserIdentifier();

// Clear on sign-out
Bugsee.clearUserIdentifier();
Found an issue, typo, or wrong statement on this page? Report it now →