diff --git a/DOT_ENV_TEMPLATE.md b/DOT_ENV_TEMPLATE.md index 97ebd7b..aed6945 100644 --- a/DOT_ENV_TEMPLATE.md +++ b/DOT_ENV_TEMPLATE.md @@ -5,4 +5,6 @@ REACT_APP_API_URL=http://your-api-url.com REACT_APP_LOCALE="en-US" REACT_APP_USE_GOOGLE_ANALYTICS=true REACT_APP_GOOGLE_ANALYTICS="UA-XXXXXXXXX-X" +REACT_APP_USE_SENTRY=true +REACT_APP_SENTRY_DSN="https://XXXXXXXXX.XXXXXXXXX.sentry.io/XXXXXXXXX" ``` diff --git a/README.md b/README.md index 273519e..a1d904f 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,8 @@ This is an example of how to list things you need to use the software and how to REACT_APP_LOCALE="en-US" REACT_APP_USE_GOOGLE_ANALYTICS=true REACT_APP_GOOGLE_ANALYTICS="UA-XXXXXXXXX-X" + REACT_APP_USE_SENTRY=true + REACT_APP_SENTRY_DSN="https://XXXXXXXXX.XXXXXXXXX.sentry.io/XXXXXXXXX" ``` diff --git a/package.json b/package.json index 1765129..13481b9 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,14 @@ { "name": "workgroup", - "version": "0.4.1", + "version": "0.4.2", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.34", "@fortawesome/free-solid-svg-icons": "^5.15.2", "@fortawesome/react-fontawesome": "^0.1.14", "@reach/router": "^1.3.4", + "@sentry/react": "^6.15.0", + "@sentry/tracing": "^6.15.0", "@testing-library/jest-dom": "^5.11.6", "@testing-library/react": "^11.2.2", "@testing-library/user-event": "^12.6.0", diff --git a/src/index.js b/src/index.js index cd27c91..3d57006 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,21 @@ import React from 'react' import ReactDOM from 'react-dom' +import * as Sentry from '@sentry/react' +import { Integrations } from '@sentry/tracing' import App from './App' import reportWebVitals from './reportWebVitals' import 'semantic-ui-css/semantic.min.css' +if (process.env.REACT_APP_USE_SENTRY) { + Sentry.init({ + dsn: process.env.REACT_APP_SENTRY_DSN, + integrations: [new Integrations.BrowserTracing()], + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + }) +} + ReactDOM.render(, document.getElementById('root')) diff --git a/yarn.lock b/yarn.lock index d9496c5..b3815f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1940,6 +1940,81 @@ exenv "^1.2.2" prop-types "^15.6.2" +"@sentry/browser@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.15.0.tgz#7a1d316dd31cedee446e359a21774bf93d1e553d" + integrity sha512-ZiqfHK5DMVgDsgMTuSwxilWIqEnZzy4yuJ9Sr6Iap1yZddPSiKHYjbBieSHn57UsWHViRB3ojbwu44LfvXKJdQ== + dependencies: + "@sentry/core" "6.15.0" + "@sentry/types" "6.15.0" + "@sentry/utils" "6.15.0" + tslib "^1.9.3" + +"@sentry/core@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.15.0.tgz#5e877042fe18452f2273247126b32e139d5f907c" + integrity sha512-mCbKyqvD1G3Re6gv6N8tRkBz84gvVWDfLtC6d1WBArIopzter6ktEbvq0cMT6EOvGI2OLXuJ6mtHA93/Q0gGpw== + dependencies: + "@sentry/hub" "6.15.0" + "@sentry/minimal" "6.15.0" + "@sentry/types" "6.15.0" + "@sentry/utils" "6.15.0" + tslib "^1.9.3" + +"@sentry/hub@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.15.0.tgz#fb8a91d12fdd2726a884374ea7242f6bbd081d69" + integrity sha512-cUbHPeG6kKpGBaEMgbTWeU03Y1Up5T3urGF+cgtrn80PmPYYSUPvVvWlZQWPb8CJZ1yQ0gySWo5RUTatBFrEHA== + dependencies: + "@sentry/types" "6.15.0" + "@sentry/utils" "6.15.0" + tslib "^1.9.3" + +"@sentry/minimal@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.15.0.tgz#fcc083ba901cfe57d25303d0b5fa8cd13e164466" + integrity sha512-7RJIvZsjBa1qFUfMrAzQsWdfZT6Gm4t6ZTYfkpsXPBA35hkzglKbBrhhsUvkxGIhUGw/PiCUqxBUjcmzQP0vfg== + dependencies: + "@sentry/hub" "6.15.0" + "@sentry/types" "6.15.0" + tslib "^1.9.3" + +"@sentry/react@^6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.15.0.tgz#4a1a3f39f61c03a675b90a114ff79a9163bcbe3b" + integrity sha512-vrrFF/KtPJQ41tmDCWpaR+bN+/TqPwqncsGLfbClE2irY3x3eCJjT2qPstlB7NQ6rTYtScyekbB0fOoNkq9FFg== + dependencies: + "@sentry/browser" "6.15.0" + "@sentry/minimal" "6.15.0" + "@sentry/types" "6.15.0" + "@sentry/utils" "6.15.0" + hoist-non-react-statics "^3.3.2" + tslib "^1.9.3" + +"@sentry/tracing@^6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.15.0.tgz#5a5f08ee6b9cc1189227536fca053cd23488600d" + integrity sha512-V5unvX8qNEfdawX+m2n0jKgmH/YR2ItWZLH+3UevBTptO+xyfvRtpgGXYWUCo3iGvFgWb1C+iIC7LViR9rTvBg== + dependencies: + "@sentry/hub" "6.15.0" + "@sentry/minimal" "6.15.0" + "@sentry/types" "6.15.0" + "@sentry/utils" "6.15.0" + tslib "^1.9.3" + +"@sentry/types@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.15.0.tgz#a2917f8aed91471bdfd6651384ffcd47b95c43ad" + integrity sha512-zBw5gPUsofXUSpS3ZAXqRNedLRBvirl3sqkj2Lez7X2EkKRgn5D8m9fQIrig/X3TsKcXUpijDW5Buk5zeCVzJA== + +"@sentry/utils@6.15.0": + version "6.15.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.15.0.tgz#0c247cb092b1796d39c3d16d8e6977b9cdab9ca2" + integrity sha512-gnhKKyFtnNmKWjDizo7VKD0/Vx8cgW1lCusM6WI7jy2jlO3bQA0+Dzgmr4mIReZ74mq4VpOd2Vfrx7ZldW1DMw== + dependencies: + "@sentry/types" "6.15.0" + tslib "^1.9.3" + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -4770,6 +4845,11 @@ dotenv@8.2.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== +dotenv@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + duplexer@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -6098,7 +6178,7 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0: +hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==