setUserId static method

Future<void> setUserId(
  1. String? userId
)

Sets the current user of your application.

This is a convenience method wrapping setUser.

If you use an email address to identify the user, please consider using setUser instead of this method as it would allow you to set the email address into both the identifier and email fields of the crash data to be sent.

userId A user name or email address representing the current user.

Set to null to clear User Id

Implementation

static Future<void> setUserId(String? userId) async {
  Settings.userInfo = RaygunUserInfo(identifier: userId);
}