Skip to content

Commit

Permalink
Merge pull request #98 from glific/sentry-setup
Browse files Browse the repository at this point in the history
added sentry support
  • Loading branch information
kurund authored Jun 27, 2020
2 parents 69e8251 + 003d60d commit 1db5241
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_GLIFIC_API="http://localhost:4000/api"
REACT_APP_WEB_SOCKET="ws://localhost:4000/socket"
SENTRY_DSN=""
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/styles": "^4.10.0",
"@sentry/browser": "^5.18.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/config/absinthe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SOCKET } from './config';
import { SOCKET } from '.';
const AbsintheSocket = require('@absinthe/socket');
const SocketApolloLink = require('@absinthe/socket-apollo-link');
const Socket = require('phoenix');
Expand Down
2 changes: 1 addition & 1 deletion src/config/apolloclient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloClient, InMemoryCache, createHttpLink, split } from '@apollo/client';
import absinthe from './absinthe';
import { URI } from './config';
import { URI } from '.';

const subscribe = require('@jumpn/utils-graphql');

Expand Down
1 change: 1 addition & 0 deletions src/config/config.ts → src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ const envVariables = process.env;

export const URI = envVariables.REACT_APP_GLIFIC_API;
export const SOCKET = envVariables.REACT_APP_WEB_SOCKET;
export const SENTRY_DSN = envVariables.SENTRY_DSN;
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { ThemeProvider, CssBaseline } from '@material-ui/core';
import { ApolloProvider } from '@apollo/client';
import * as Sentry from '@sentry/browser';

import theme from './config/theme';
import gqlClient from './config/apolloclient';
import { SENTRY_DSN } from './config/';

import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

// setup data source for sentry
if (SENTRY_DSN) {
Sentry.init({ dsn: SENTRY_DSN });
}

ReactDOM.render(
<React.StrictMode>
<CssBaseline />
Expand Down

0 comments on commit 1db5241

Please sign in to comment.