Implement error logging (sentry)
right now i'm trying to implement sentry (error tracking) into my Bonita living application.
You basically have to add a html script tag on every page which is executed as early as possible.
Sentry has 2 options to do this:
1) use npm/yarn
2) include the html script tag directly into the site while using a CDN and let the browser handle the download. But this has potential for errors (for example my adblocker blocks requests to download the sentry sdk when i just add a html script tag into the header)
My tried solutions:
Now i dont have that much experience in npm/yarn and node, but I created a custom Theme (myCustomTheme) in Bonita Studio (Community Edition 2021.1).Then changed my application to use this Theme. Then went into the theme directory and executed:
./node/npm install --save @sentry/browser @sentry/tracing
This installed the sentry packages into my Theme. you can now see the libraries under node_modules and in the package.json file:
Now i have found 2 problems:
- I dont find a solution to add this, already via npm installed, sentry packages to the header of each site of my custom template
- I fear that if i find a solution to problem 1 and the script will be loaded into each site there will still be the problem that there are some forms in my living application which are loaded via an iframe. This iframe has an own context and has maybe no sentry script loaded inside
I hope you can help me with this.
Thank you in regard!