We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f23ca6e commit da34232Copy full SHA for da34232
apps/browser-extension-wallet/sentry.js
@@ -1,5 +1,6 @@
1
import * as Sentry from '@sentry/react';
2
-
+import { v4 as uuidv4 } from 'uuid';
3
+import { storage } from 'webextension-polyfill';
4
Sentry.init({
5
environment: process.env.SENTRY_ENVIRONMENT,
6
dsn: process.env.SENTRY_DSN,
@@ -19,3 +20,11 @@ Sentry.init({
19
20
// ...plus for 100% of sessions with an error
21
replaysOnErrorSampleRate: 1.0
22
});
23
+
24
+storage.local.get('SENTRY-UUID').then((storageVar) => {
25
+ let sentryUuid = storageVar?.['SENTRY-UUID'] ?? uuidv4();
26
+ if (!storageVar?.['SENTRY-UUID']) {
27
+ storage.local.set({ 'SENTRY-UUID': sentryUuid });
28
+ }
29
+ Sentry.setUser({ id: sentryUuid });
30
+});
0 commit comments