aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/constants.ts3
-rw-r--r--packages/instant/src/util/error_reporter.ts13
2 files changed, 5 insertions, 11 deletions
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index 23660360d..dfa7520f8 100644
--- a/packages/instant/src/constants.ts
+++ b/packages/instant/src/constants.ts
@@ -21,12 +21,13 @@ export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2';
export const PROGRESS_STALL_AT_WIDTH = '95%';
export const PROGRESS_FINISH_ANIMATION_TIME_MS = 200;
export const ROLLBAR_CLIENT_TOKEN = process.env.ROLLBAR_CLIENT_TOKEN;
-export const ROLLBAR_ENVIRONMENT = process.env.ROLLBAR_ENVIRONMENT as
+export const INSTANT_ENVIRONMENT = process.env.INSTANT_ENVIRONMENT as
| 'dogfood'
| 'staging'
| 'development'
| 'production'
| undefined;
+export const ROLLBAR_ENABLED = process.env.ROLLBAR_ENABLED;
export const COINBASE_WALLET_IOS_APP_STORE_URL = 'https://itunes.apple.com/us/app/coinbase-wallet/id1278383455?mt=8';
export const COINBASE_WALLET_ANDROID_APP_STORE_URL = 'https://play.google.com/store/apps/details?id=org.toshi&hl=en';
export const COINBASE_WALLET_SITE_URL = 'https://wallet.coinbase.com/';
diff --git a/packages/instant/src/util/error_reporter.ts b/packages/instant/src/util/error_reporter.ts
index c5766b469..89c5b6bd3 100644
--- a/packages/instant/src/util/error_reporter.ts
+++ b/packages/instant/src/util/error_reporter.ts
@@ -1,24 +1,17 @@
import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
-import { ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENVIRONMENT } from '../constants';
+import { INSTANT_ENVIRONMENT, ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENABLED } from '../constants';
// Import version of Rollbar designed for embedded components
// See https://docs.rollbar.com/docs/using-rollbarjs-inside-an-embedded-component
// tslint:disable-next-line:no-var-requires
const Rollbar = require('rollbar/dist/rollbar.noconflict.umd');
-const shouldAllowRollbar = () => {
- if (ROLLBAR_ENVIRONMENT === 'development') {
- return process.env.ROLLBAR_FORCE_DEVELOPMENT_REPORT ? true : false;
- }
- return true;
-};
-
let rollbar: any;
// Configures rollbar and sets up error catching
export const setupRollbar = (): any => {
- if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && ROLLBAR_ENVIRONMENT && shouldAllowRollbar()) {
+ if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && INSTANT_ENVIRONMENT && ROLLBAR_ENABLED) {
rollbar = new Rollbar({
accessToken: ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
@@ -27,7 +20,7 @@ export const setupRollbar = (): any => {
itemsPerMinute: 10,
maxItems: 500,
payload: {
- environment: ROLLBAR_ENVIRONMENT,
+ environment: INSTANT_ENVIRONMENT,
client: {
javascript: {
source_map_enabled: true,