Skip to content

Identify the signed in user after the client is initialized #189

@dgilperez

Description

@dgilperez

Setting up Sentry on our flutter app, we instantiate the SentryClient just by adding the dsn param and no other context as instructed. Exceptions get catched in the guarded zone and using FlutterError.onError.

Later on the the execution of the code, a user signs in, so we'd like to add that information to next errors. I don't see a client.identify method, which is the strategy crashlytics uses (what we use now) FirebaseCrashlytics.instance.setUserIdentifier(_currentUser.userId);. We can't add that context on app start, and we can't access current user since it's not global.

How should we make Sentry aware of that context at any point of the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions