JulianMar / nuxt-bugsnag

Bugsnag module for nuxt.js
MIT License
49 stars 18 forks source link

Identify users #64

Closed Youhan closed 11 months ago

Youhan commented 11 months ago

On the docs, it looks like it is possible to identify users by adding it to the sent event like this

Bugsnag.start({
  onError: function (event) {
    event.setUser('3', 'bugs.nag@bugsnag.com', 'Bugs Nag')
  }
})

Would it be possible to do it with the module?

My user is a reactive useState ref that is null initially but may get populated if the user signs in.

Youhan commented 11 months ago

Just to clarify, it is possible to setUser while using the .notify method. But that's only for handled errors.

JulianMar commented 11 months ago

Hey, you can use the second method from the bugsnag docs. https://docs.bugsnag.com/platforms/javascript/customizing-error-reports/#adding-user-data

useBugsnag().setUser('3', 'bugs.nag@bugsnag.com', 'Bugs Nag')