Skip to content

Commit

Permalink
use window vars for sentry and correct env name (airbytehq#6802)
Browse files Browse the repository at this point in the history
* fall back to window var for sentry initialization

* correct naming

* add dsn to window type

* fix naming
  • Loading branch information
jrhizor authored Oct 8, 2021
1 parent ec68f47 commit 5d9d36b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airbyte-webapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ REACT_APP_SEGMENT_TOKEN=6cxNSmQyGSKcATLdJ2pL6WsawkzEMDAN
REACT_APP_FULL_STORY_ORG=13AXQ4
REACT_APP_PAPERCUPS_ACCOUNT_ID=74560291-451e-4ceb-a802-56706ece528b
REACT_APP_OPEN_REPLAY_PROJECT_ID=6611843272536134
REACT_APP_SENTRY_DNS=
REACT_APP_SENTRY_DSN=
REACT_APP_INTERCOM_APP_ID=nj1oam7s
1 change: 1 addition & 0 deletions airbyte-webapp/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare global {
FIREBASE_API_KEY?: string;
FIREBASE_AUTH_DOMAIN?: string;
CLOUD_API_URL?: string;
REACT_APP_SENTRY_DSN?: string;

analytics: SegmentAnalytics;
_API_URL: string;
Expand Down
4 changes: 3 additions & 1 deletion airbyte-webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import * as Sentry from "@sentry/react";

// We do not follow default config approach that we follow as we want to init
// sentry asap
Sentry.init({ dsn: process.env.REACT_APP_SENTRY_DNS });
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN || window.REACT_APP_SENTRY_DSN,
});

const CloudApp = lazy(() => import(`packages/cloud/App`));
const App = lazy(() => import(`./App`));
Expand Down

0 comments on commit 5d9d36b

Please sign in to comment.