SentryUser class
Describes the current user associated with the application, such as the currently signed in user.
The user can be specified globally in the Scope.user field, or per event in the SentryEvent.user field.
You should provide at least one of id, email, ipAddress, username for Sentry to be able to tell you how many users are affected by one issue, for example. Sending a user that has none of these attributes and only custom attributes is valid, but not as useful.
Conforms to the User Interface contract for Sentry https://develop.sentry.dev/sdk/event-payloads/user/
The outgoing JSON representation is:
"user": {
"id": "unique_id",
"username": "my_user",
"email": "foo@example.com",
"ip_address": "127.0.0.1",
"segment": "segment"
}
- Annotations
-
- @immutable
Constructors
-
SentryUser({String? id, String? username, String? email, String? ipAddress, String? segment, SentryGeo? geo, String? name, Map<
String, dynamic> ? data, @Deprecated('Will be removed in v8. Use [data] instead') Map<String, dynamic> ? extras, Map<String, dynamic> ? unknown}) -
You should provide at least one of
id
,email
,ipAddress
,username
for Sentry to be able to tell you how many users are affected by one issue, for example. Sending a user that has none of these attributes and only custom attributes is valid, but not as useful. -
SentryUser.fromJson(Map<
String, dynamic> jsonData) -
Deserializes a SentryUser from JSON Map.
factory
Properties
-
data
→ Map<
String, dynamic> ? -
Any other user context information that may be helpful.
final
- email → String?
-
The email address of the user.
final
-
extras
→ Map<
String, dynamic> ? -
final
- geo → SentryGeo?
-
Approximate geographical location of the end user or device.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
A unique identifier of the user.
final
- ipAddress → String?
-
The IP of the user.
final
- name → String?
-
Human readable name of the user.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segment → String?
-
The user segment, for apps that divide users in user segments.
final
-
unknown
→ Map<
String, dynamic> ? -
final
- username → String?
-
The username of the user.
final
Methods
-
copyWith(
{String? id, String? username, String? email, String? ipAddress, String? segment, Map< String, dynamic> ? extras, String? name, SentryGeo? geo, Map<String, dynamic> ? data}) → SentryUser -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Produces a Map that can be serialized to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited