sentry-configuration
v1.2.0
Published
sentry的公共配置文件
Downloads
50
Readme
sentry的公共配置
#发布方法方法 修改代码逻辑后,运行 npm run release 打包并发布到npm
使用的前提条件:./ vue项目
VUE_APP_RELEASE = '[email protected]' //vue2版本 VITE_RELEASE = '[email protected]' //vue3版本
VUE_APP_DSN = 'dsn...' //vue2版本 VITE_SENTRY_DSN = 'dsn...' //vue3版本
VUE_APP_CURRENTENV = 'DEV/TEST/PROD' //vue2版本 VITE_CURRENTENV = 'DEV/TEST/PROD' //vue3版本
npm install -S sentry-configuration
import SentryReport from 'sentry-configuration'; Vue.use(SentryReport, {router, sentryOptions})
const userInfo = { username: username, id: userId, email: username, //这个在sentry后台最显眼,一般把用户名放在email中 }
const $sentry = Vue.prototype.$sentry if($sentry){ $sentry.setUser(userInfo) $sentry.setExtras({ ...userInfoObj. }) }