diff --git a/assets/js/app.tsx b/assets/js/app.tsx index 7d91b162..cf677ec8 100644 --- a/assets/js/app.tsx +++ b/assets/js/app.tsx @@ -13,6 +13,7 @@ import ReactDOM from "react-dom"; import App from "./components/App"; import * as Sentry from "@sentry/react"; import { FullStory, init as initFullStory } from "@fullstory/browser"; +import SentryFullStory from "@sentry/fullstory"; const environment = document .querySelector("meta[name=environment-name]") @@ -23,17 +24,7 @@ const sentryDsn = document const username = document .querySelector("meta[name=username]") ?.getAttribute("content"); - -if (sentryDsn) { - Sentry.init({ - dsn: sentryDsn, - environment: environment, - }); - - if (username) { - Sentry.setUser({ username: username }); - } -} +const SENTRY_ORG_SLUG = "mbtace"; const fullstoryOrgId = document .querySelector("meta[name=fullstory-org-id]") @@ -50,4 +41,16 @@ if (fullstoryOrgId) { } } +if (sentryDsn) { + Sentry.init({ + dsn: sentryDsn, + environment: environment, + integrations: [new SentryFullStory(SENTRY_ORG_SLUG, { client: FullStory })], + }); + + if (username) { + Sentry.setUser({ username: username }); + } +} + ReactDOM.render(, document.getElementById("app")); diff --git a/assets/package-lock.json b/assets/package-lock.json index 5b8b95c8..7952991d 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -8,6 +8,7 @@ "dependencies": { "@fullstory/browser": "^2.0.4", "@heroicons/react": "^1.0.4", + "@sentry/fullstory": "^2.1.0", "@sentry/react": "^7.14.0", "bootstrap": "^5.1.3", "date-fns": "^3.6.0", @@ -3186,6 +3187,14 @@ "node": ">=8" } }, + "node_modules/@sentry/fullstory": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sentry/fullstory/-/fullstory-2.1.0.tgz", + "integrity": "sha512-jUzt7R+UDG0HwAz9yZw9NDoFUwDuFR7mliw0RvYyELQ2TCqYJUvmS+7eDwQzCfSRke2IyccDNjhutIni13uqbg==", + "peerDependencies": { + "@sentry/core": "4.x || 5.x || 6.x || 7.x" + } + }, "node_modules/@sentry/react": { "version": "7.109.0", "license": "MIT", diff --git a/assets/package.json b/assets/package.json index 647f80c9..da0e95da 100644 --- a/assets/package.json +++ b/assets/package.json @@ -15,6 +15,7 @@ "dependencies": { "@fullstory/browser": "^2.0.4", "@heroicons/react": "^1.0.4", + "@sentry/fullstory": "^2.1.0", "@sentry/react": "^7.14.0", "bootstrap": "^5.1.3", "date-fns": "^3.6.0",