Javascript 如何在react native中将用户ID传递给sentry?
到目前为止,我们向哨兵发送错误的方式有两种:Javascript 如何在react native中将用户ID传递给sentry?,javascript,react-native,logging,sentry,react-native-sentry,Javascript,React Native,Logging,Sentry,React Native Sentry,到目前为止,我们向哨兵发送错误的方式有两种: 所有的错误都被哨兵抓住了 我们的组件使用captureException 我们希望将用户ID传递给sentry,它存储在AuthContext中,可以使用react钩子读取 我如何重新配置哨兵以传入此信息 我应该使用: Sentry.setExtra(“userId”,userId) Sentry.withScope((scope)=>{scope.setExtra(“userId”,userId);}) Sentry.configureScope
错误
都被哨兵抓住了
组件使用captureException
用户ID
传递给sentry,它存储在AuthContext
中,可以使用react钩子读取
我如何重新配置哨兵以传入此信息
我应该使用:
Sentry.setExtra(“userId”,userId)代码>
Sentry.withScope((scope)=>{scope.setExtra(“userId”,userId);})
Sentry.configureScope(scope=>{scope.setExtra(“userId”,userId);})