feat(webui): add Sentry user feedback
This commit is contained in:
parent
5de0780ab5
commit
858815985c
2 changed files with 6 additions and 2 deletions
|
@ -14,7 +14,7 @@ Sentry.init({
|
|||
replaysOnErrorSampleRate: 1.0,
|
||||
|
||||
// If you don't want to use Session Replay, just remove the line below:
|
||||
integrations: [replayIntegration()],
|
||||
integrations: [replayIntegration(), Sentry.feedbackIntegration({ colorScheme: 'dark' })],
|
||||
|
||||
enabled: process.env.NODE_ENV !== 'development'
|
||||
});
|
||||
|
|
|
@ -2,6 +2,7 @@ import { UpEndApi } from '@upnd/upend';
|
|||
import { UpEndWasmExtensionsWeb } from '@upnd/upend/wasm/web';
|
||||
import wasmURL from '@upnd/wasm-web/upend_wasm_bg.wasm?url';
|
||||
import { type StartStopNotifier, writable, type Writable } from 'svelte/store';
|
||||
import * as Sentry from '@sentry/sveltekit';
|
||||
|
||||
const wasm = new UpEndWasmExtensionsWeb(wasmURL);
|
||||
const api = new UpEndApi({ instanceUrl: '/', wasmExtensions: wasm });
|
||||
|
@ -10,7 +11,10 @@ export default api;
|
|||
export const currentUser: Writable<string | undefined> = writable(
|
||||
undefined as string | undefined,
|
||||
((set) => {
|
||||
api.authStatus().then((result) => set(result?.user));
|
||||
api.authStatus().then((result) => {
|
||||
set(result?.user);
|
||||
Sentry.setUser({ id: result?.user });
|
||||
});
|
||||
}) as StartStopNotifier<string | undefined>
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue