diff --git a/README.md b/README.md index 883cee884..d5b5f7a4a 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,15 @@ Once `.env` files is created adjust it to your needs, and update `LACE_EXTENSION > If you want to develop DApp Explorer please refer to the [Setting up local connection with DApp Radar API](apps/browser-extension-wallet/src/views/browser-view/features/dapp/README.md) page +#### Configure Sentry for the local dev environment + +If you want to log errors to Sentry from you local dev environment you need to provide in your `.env` file Sentry [dsn](https://docs.sentry.io/platforms/javascript/configuration/options/#dsn) and [environment](https://docs.sentry.io/platforms/javascript/configuration/options/#environment) values. +``` +SENTRY_DSN= +SENTRY_ENVIRONMENT=development +``` +To get **Sentry dsn** log in to [Sentry](https://iohk-j4.sentry.io/) and go to `Settings -> Projects -> lace-extension-v1 -> Client Keys` or click [here](https://iohk-j4.sentry.io/settings/projects/lace-extension-v1/keys/). + ### Build packages and extension ```sh diff --git a/apps/browser-extension-wallet/.env.defaults b/apps/browser-extension-wallet/.env.defaults index 9bbdc948b..1cfb00536 100644 --- a/apps/browser-extension-wallet/.env.defaults +++ b/apps/browser-extension-wallet/.env.defaults @@ -76,7 +76,7 @@ SENTRY_AUTH_TOKEN= SENTRY_DSN= SENTRY_ORG= SENTRY_PROJECT= -SENTRY_ENVIRONMENT=development +SENTRY_ENVIRONMENT= # Cardano Services CARDANO_SERVICES_URL_MAINNET=https://live-mainnet.lw.iog.io diff --git a/apps/browser-extension-wallet/sentry.js b/apps/browser-extension-wallet/sentry.js index cb8c8288d..490e06af3 100644 --- a/apps/browser-extension-wallet/sentry.js +++ b/apps/browser-extension-wallet/sentry.js @@ -1,6 +1,7 @@ import * as Sentry from '@sentry/react'; import { v4 as uuidv4 } from 'uuid'; import { storage } from 'webextension-polyfill'; + Sentry.init({ environment: process.env.SENTRY_ENVIRONMENT, dsn: process.env.SENTRY_DSN,