You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@sentry/nestjs

Package Overview
Dependencies
Maintainers
10
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/nestjs

Official Sentry SDK for NestJS

9.39.0
latest
Source
npmnpm
Version published
Weekly downloads
342K
7.29%
Maintainers
10
Weekly downloads
 
Created

What is @sentry/nestjs?

@sentry/nestjs is a package that provides integration of Sentry with NestJS applications. It allows developers to easily add error tracking and performance monitoring to their NestJS applications, helping them to identify and fix issues more efficiently.

What are @sentry/nestjs's main functionalities?

Error Tracking

This feature allows you to integrate Sentry's error tracking capabilities into your NestJS application. By providing your DSN (Data Source Name), you can automatically capture and report errors to Sentry.

import { Module } from '@nestjs/common';
import { SentryModule } from '@ntegral/nestjs-sentry';

@Module({
  imports: [
    SentryModule.forRoot({
      dsn: 'your-dsn-url',
    }),
  ],
})
export class AppModule {}

Performance Monitoring

This feature allows you to monitor the performance of your NestJS application by capturing the duration of requests and sending this information to Sentry. This can help in identifying performance bottlenecks.

import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import * as Sentry from '@sentry/node';

@Injectable()
export class SentryInterceptor implements NestInterceptor {
  intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
    const now = Date.now();
    return next
      .handle()
      .pipe(
        tap(() => Sentry.captureMessage(`Request took ${Date.now() - now}ms`))
      );
  }
}

Other packages similar to @sentry/nestjs

FAQs

Package last updated on 15 Jul 2025

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