vue-raven icon indicating copy to clipboard operation
vue-raven copied to clipboard

add setContext functionality to this.$raven

Open dohomi opened this issue 7 years ago • 7 comments
trafficstars

Hello I just added your plugin and thought being able to set user context through this.$raven. But unfortunately its not possible.

this.$raven.setUserContext(USER)

what is the recommended way to do this? Thanks

dohomi avatar Aug 06 '18 01:08 dohomi

Additionally you can provide arbitrary key/value pairs beyond the reserved names and those will be stored with the user. Capturing the User

the USER parameter is an object?

anteriovieira avatar Aug 06 '18 12:08 anteriovieira

@anteriovieira yes. I am talking about this functionality: https://docs.sentry.io/learn/context/ I'd like to set the user context after login/logout to keep track which user is causing the trouble.

dohomi avatar Aug 07 '18 00:08 dohomi

Hi @dohomi , sorry for the delay in answering, I know it's been a long time so I'd like to know what your progress was.

anteriovieira avatar Sep 18 '18 12:09 anteriovieira

Why were not you able to define the context? What happened?

anteriovieira avatar Sep 18 '18 12:09 anteriovieira

@anteriovieira I am importing currently Raven and setting the context. Your plugin does not provide the functionality to do this directly with this.$raven.setContext()

dohomi avatar Sep 18 '18 12:09 dohomi

Hi @dohomi , Can you give me an example of your code? this.$raven is just a reference to Raven, so I do not understand how this does not work.

https://github.com/anteriovieira/vue-raven/blob/master/src/index.js#L56

anteriovieira avatar Sep 18 '18 13:09 anteriovieira

If the disableReport option is set to false, Vue.$raven does not have any functionality: https://github.com/anteriovieira/vue-raven/blob/master/src/index.js#L22.

sisou avatar Nov 27 '18 01:11 sisou