Skip to content

Commit f4ac4f4

Browse files
authored
Merge pull request #31 from finmars-platform/PLAT-1907
Add senty
2 parents 7db445a + 4b871f3 commit f4ac4f4

File tree

5 files changed

+114
-1
lines changed

5 files changed

+114
-1
lines changed

docker/substitute_environment_variables.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ echo PROD_KEYCLOAK_URL $PROD_KEYCLOAK_URL
1414
echo PROD_KEYCLOAK_REALM $PROD_KEYCLOAK_REALM
1515
echo PROD_KEYCLOAK_CLIENT_ID $PROD_KEYCLOAK_CLIENT_ID
1616
echo PROD_EDITION_TYPE $PROD_EDITION_TYPE
17+
echo SENTRY_DSN $SENTRY_DSN
1718

1819
# Replace env vars in .mjs files served by server
1920
# Exclude /node_modules folder from the search and replacement
@@ -27,7 +28,7 @@ do
2728
sed -i 's|==PROD_KEYCLOAK_REALM==|'${PROD_KEYCLOAK_REALM}'|g' $file
2829
sed -i 's|==PROD_KEYCLOAK_CLIENT_ID==|'${PROD_KEYCLOAK_CLIENT_ID}'|g' $file
2930
sed -i 's|==PROD_EDITION_TYPE==|'${PROD_EDITION_TYPE}'|g' $file
30-
31+
sed -i 's|==SENTRY_DSN==|'${SENTRY_DSN}'|g' $file
3132
done
3233

3334
echo "DONE REPLACE"

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default defineNuxtConfig({
2121

2222
buildDATE: dayjs().format('HH:mm DD/MM/YYYY'),
2323
EDITION_TYPE: process.env.EDITION_TYPE || '==PROD_EDITION_TYPE==',
24+
SENTRY_DSN: process.env.SENTRY_DSN || '==SENTRY_DSN==',
2425
}
2526
},
2627
ssr: false,

package-lock.json

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@formbricks/js": "1.1.2",
3939
"@kyvg/vue3-notification": "^2.4.1",
4040
"@pinia/nuxt": "^0.5.1",
41+
"@sentry/vue": "^10.23.0",
4142
"@vue/web-component-wrapper": "^1.3.0",
4243
"ace-builds": "^1.36.2",
4344
"chart.js": "^3.9.1",

src/plugins/sentry.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as Sentry from '@sentry/vue'
2+
3+
export default defineNuxtPlugin((nuxtApp) => {
4+
5+
const router = useRouter()
6+
const { public: { sentry } } = useRuntimeConfig()
7+
8+
const dsn = useRuntimeConfig().public.SENTRY_DSN;
9+
10+
if (dsn.indexOf('SENTRY_DSN') !== -1) {
11+
return
12+
}
13+
14+
Sentry.init({
15+
app: nuxtApp.vueApp,
16+
dsn: dsn,
17+
})
18+
19+
});

0 commit comments

Comments
 (0)