On its own, @sentry/browser will report any uncaught exceptions triggered from your application. Additionally, @sentry/browser can be configured to catch any Angular-specific (2.x) exceptions reported through the @angular/core/ErrorHandler component. This is also a great opportunity to collect user feedback by using Sentry.showReportDialog.

First, install @sentry/browser:

# Using yarn
yarn add @sentry/browser

# Using npm
npm install @sentry/browser
import { BrowserModule } from "@angular/platform-browser";
import { NgModule, ErrorHandler, Injectable } from "@angular/core";

import { AppComponent } from "./app.component";

import * as Sentry from "@sentry/browser";

  dsn: "___PUBLIC_DSN___"

export class SentryErrorHandler implements ErrorHandler {
  constructor() {}
  handleError(error) {
    const eventId = Sentry.captureException(error.originalError || error);
    Sentry.showReportDialog({ eventId });

  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [{ provide: ErrorHandler, useClass: SentryErrorHandler }],
  bootstrap: [AppComponent]

export class AppModule {}

AngularJS 1.x

If you’re using AngularJS 1.x, you can use Sentry’s AngularJS integration.

First, install @sentry/browser and @sentry/integrations:

# Using yarn
yarn add @sentry/browser @sentry/integrations

# Using npm
npm install @sentry/browser @sentry/integrations
import angular from 'angular';
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';

// Make sure to call Sentry.init after importing AngularJS. 
// You can also pass {angular: AngularInstance} to the Integrations.Angular() constructor.
  dsn: '___PUBLIC_DSN___',
  integrations: [
    new Integrations.Angular(),

// Finally require ngSentry as a dependency in your application module.
angular.module('yourApplicationModule', ['ngSentry']);

In case you’re using the CDN version or the Loader, Sentry provides a standalone file for every integration:

<!-- Note that we now also provide a es6 build only -->
<!-- <script src="" integrity="sha384-We4BBcWghB7g6R5z3hfndCbJtjfsHkCCID/h5xB43VjWH1njPjZDfKD2jqQFxW0T" crossorigin="anonymous"></script> -->
<script src="" integrity="sha384-HA4Glk4hAwUFBIu+OfNR4bvn6vGCxT134gRiQce9rwp2YfxcuHHG8nG7qkooJwFt" crossorigin="anonymous"></script>

<!-- If you include the integration it will be available under Sentry.Integrations.Angular -->
<script src="" crossorigin="anonymous"></script>

    dsn: '___PUBLIC_DSN___',
    integrations: [
      new Sentry.Integrations.Angular(),
On this page