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 either an id (a unique identifier for an authenticated user) or ipAddress (their IP address).

Conforms to the User Interface contract for Sentry https://docs.sentry.io/clientdev/interfaces/user/.

The outgoing JSON representation is:

"user": {
  "id": "unique_id",
  "username": "my_user",
  "email": "foo@example.com",
  "ip_address": "127.0.0.1",
  "subscription": "basic"
}
Annotations
  • @immutable

Constructors

SentryUser({String? id, String? username, String? email, String? ipAddress, Map<String, dynamic>? extras})
At a minimum you must set an id or an ipAddress.

Properties

email String?
The email address of the user.
final
extras Map<String, dynamic>?
Any other user context information that may be helpful.
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
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
username String?
The username of the user.
final

Methods

copyWith({String? id, String? username, String? email, String? ipAddress, Map<String, dynamic>? extras}) 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