Initialize sentry after getting API status

This commit is contained in:
Eli Ribble 2026-04-21 23:58:04 +00:00
parent 839abcbd28
commit 986d12eab2
No known key found for this signature in database
3 changed files with 17 additions and 10 deletions

View file

@ -3,9 +3,24 @@
</template>
<script setup lang="ts">
import * as Sentry from "@sentry/vue";
import { onMounted } from "vue";
import { apiClient } from "@/client";
import router from "@/router";
import { SSEManager, type SSEMessage } from "@/SSEManager";
async function sentryInit() {
const config = await apiClient.JSONGet("/api");
Sentry.init({
dsn: config.DSN,
integrations: [Sentry.browserTracingIntegration({ router })],
environment: config.ENVIRONMENT,
release: config.RELEASE,
tracesSampleRate: 0.01,
});
console.log("sentry initialized");
}
onMounted(() => {
SSEManager.connect("/api/events");
SSEManager.subscribe((msg: SSEMessage) => {
@ -13,5 +28,6 @@ onMounted(() => {
console.log("SSE", msg);
}
});
sentryInit();
});
</script>