🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@sentry/angular

Package Overview
Dependencies
Maintainers
11
Versions
460
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/angular

Official Sentry SDK for Angular

8.16.0
Source
npm
Version published
Weekly downloads
211K
8.39%
Maintainers
11
Weekly downloads
 
Created

What is @sentry/angular?

@sentry/angular is a package that provides error tracking and performance monitoring for Angular applications. It helps developers capture and report errors, track performance issues, and gain insights into the health of their applications.

What are @sentry/angular's main functionalities?

Error Tracking

This feature allows you to capture and report errors in your Angular application. By initializing Sentry with your DSN and implementing a custom ErrorHandler, you can automatically send error reports to Sentry.

import * as Sentry from '@sentry/angular';
import { ErrorHandler } from '@angular/core';

Sentry.init({
  dsn: 'your-dsn-url',
});

export class SentryErrorHandler implements ErrorHandler {
  handleError(error) {
    Sentry.captureException(error);
    throw error;
  }
}

Performance Monitoring

This feature allows you to monitor the performance of your Angular application. By configuring Sentry with the BrowserTracing integration and setting a sample rate, you can track performance metrics and identify bottlenecks.

import * as Sentry from '@sentry/angular';

Sentry.init({
  dsn: 'your-dsn-url',
  integrations: [
    new Sentry.BrowserTracing({
      tracingOrigins: ['localhost', 'https://yourserver.io'],
      routingInstrumentation: Sentry.routingInstrumentation,
    }),
  ],
  tracesSampleRate: 1.0,
});

User Feedback

This feature allows you to collect user feedback when an error occurs. By calling the showReportDialog method with the event ID, you can prompt users to provide additional information about the error.

import * as Sentry from '@sentry/angular';

Sentry.init({
  dsn: 'your-dsn-url',
});

function captureUserFeedback(eventId) {
  Sentry.showReportDialog({
    eventId: eventId,
  });
}

Other packages similar to @sentry/angular

FAQs

Package last updated on 09 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts