summaryrefslogtreecommitdiff
path: root/packages/frontend/src/boot
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-04-02 22:29:14 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-04-02 22:29:14 -0400
commitdab9b518e48f04833708a1704e331fd262f575bd (patch)
treeca4dfba2efbe5d550c7d19474d4d91850cb6ccd2 /packages/frontend/src/boot
parentfix vue warning about render functions (diff)
parent🎨 (diff)
downloadsharkey-dab9b518e48f04833708a1704e331fd262f575bd.tar.gz
sharkey-dab9b518e48f04833708a1704e331fd262f575bd.tar.bz2
sharkey-dab9b518e48f04833708a1704e331fd262f575bd.zip
merge from misskey-develop
Diffstat (limited to 'packages/frontend/src/boot')
-rw-r--r--packages/frontend/src/boot/common.ts37
1 files changed, 36 insertions, 1 deletions
diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts
index defdb00568..918a3703c3 100644
--- a/packages/frontend/src/boot/common.ts
+++ b/packages/frontend/src/boot/common.ts
@@ -5,7 +5,7 @@
import { watch, version as vueVersion } from 'vue';
import { compareVersions } from 'compare-versions';
-import { version, lang, langsVersion, updateLocale, locale } from '@@/js/config.js';
+import { version, lang, langsVersion, updateLocale, locale, apiUrl } from '@@/js/config.js';
import defaultLightTheme from '@@/themes/l-light.json5';
import defaultDarkTheme from '@@/themes/d-green-lime.json5';
import type { App } from 'vue';
@@ -282,6 +282,41 @@ export async function common(createVue: () => Promise<App<Element>>) {
return root;
})();
+ if (instance.sentryForFrontend) {
+ const Sentry = await import('@sentry/vue');
+ Sentry.init({
+ app,
+ integrations: [
+ ...(instance.sentryForFrontend.vueIntegration !== undefined ? [
+ Sentry.vueIntegration(instance.sentryForFrontend.vueIntegration ?? undefined),
+ ] : []),
+ ...(instance.sentryForFrontend.browserTracingIntegration !== undefined ? [
+ Sentry.browserTracingIntegration(instance.sentryForFrontend.browserTracingIntegration ?? undefined),
+ ] : []),
+ ...(instance.sentryForFrontend.replayIntegration !== undefined ? [
+ Sentry.replayIntegration(instance.sentryForFrontend.replayIntegration ?? undefined),
+ ] : []),
+ ],
+
+ // Set tracesSampleRate to 1.0 to capture 100%
+ tracesSampleRate: 1.0,
+
+ // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
+ ...(instance.sentryForFrontend.browserTracingIntegration !== undefined ? {
+ tracePropagationTargets: [apiUrl],
+ } : {}),
+
+ // Capture Replay for 10% of all sessions,
+ // plus for 100% of sessions with an error
+ ...(instance.sentryForFrontend.replayIntegration !== undefined ? {
+ replaysSessionSampleRate: 0.1,
+ replaysOnErrorSampleRate: 1.0,
+ } : {}),
+
+ ...instance.sentryForFrontend.options,
+ });
+ }
+
app.mount(rootEl);
// boot.jsのやつを解除