mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-23 00:33:50 +02:00
add Sentry error reporting option
This commit is contained in:
33
src/plugin/sentry.js
Normal file
33
src/plugin/sentry.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as Sentry from '@sentry/vue';
|
||||
import configRepository from '../service/config';
|
||||
|
||||
export function initSentry(app) {
|
||||
configRepository
|
||||
.getString('VRCX_SentryEnabled', 'false')
|
||||
.then((enabled) => {
|
||||
let isNightly = false;
|
||||
AppApi.GetVersion().then(
|
||||
(v) => (isNightly = v.includes('Nightly'))
|
||||
);
|
||||
if (enabled === 'true' && isNightly) {
|
||||
Sentry.init({
|
||||
app,
|
||||
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
|
||||
environment: 'nightly',
|
||||
sampleRate: 0.1,
|
||||
beforeSend(event) {
|
||||
if (
|
||||
event.message &&
|
||||
(event.message.toLowerCase().includes('password') ||
|
||||
event.message.toLowerCase().includes('token'))
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return event;
|
||||
},
|
||||
integrations: []
|
||||
});
|
||||
console.log('Sentry initialized');
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user