Let's perform the following steps to add production tracking and monitoring to our Angular application with Sentry:
- First, we will need to add our Sentry DSN API key to our application's /src/environments/environment.ts and /src/environments/environment.prod.ts configurations. The main difference here is the production flag, which we can set to true for simplicity with testing our integration, for now:
export const environment = { production: true, sentryDSN: 'https://xxxxxxxxxxxxxxxx@sentry.io/xxxxx' ...}
- Before working with any new library in Angular, it's a good idea to add the type definitions to your project's tsconfig.json configuration. raven-js includes its own typescript definitions inside its typescript directory. ...