Back to Skills

sentry-nestjs-sdk

Full Sentry SDK setup for NestJS. Use when asked to "add Sentry to NestJS", "install @sentry/nestjs", "setup Sentry in NestJS", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for NestJS applications. Supports Express and Fastify adapters, GraphQL, microservices, WebSockets, and background jobs.

232stars30forksUpdated 7/4/2026

Security Assessment

Low Risk(85/100)

Detected risks:

Agent-reviewed override('crontab' matches are Sentry's own cron-monitoring feature (references/crons.md); '.env' is standard Sentry SDK DSN/config across monitoring docs. Legitimate SDK setup.)
Security Score85/100

About sentry-nestjs-sdk

Sentry NestJS SDK is an opinionated setup wizard for adding Sentry to a NestJS application using the @sentry/nestjs package. The referenced APIs reflect @sentry/nestjs 10.x with NestJS 8 through 11 supported, and it covers both the Express (default) and Fastify adapters as well as GraphQL, microservices, WebSockets, and background jobs. It is the skill to use for requests like adding Sentry to NestJS or configuring error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring in a NestJS service.

Work proceeds in phases. The Detect phase runs a series of grep and node commands to understand the project before recommending anything: confirming it is a NestJS app and its version, checking for an existing Sentry install and instrument.ts, spotting a Sentry dependency-injection wrapper or a typed config class, seeing whether SentryModule.forRoot is already registered, and detecting the HTTP adapter, GraphQL, microservices, WebSockets, task queues such as Bull, BullMQ, or @nestjs/schedule, databases, AI libraries, and a companion frontend. The Recommend phase leads with a concrete proposal rather than open questions, always recommending error monitoring and tracing, and adding profiling, logging, metrics, crons, or AI monitoring when the corresponding signals are detected.

The Guide phase installs the SDK, optionally with @sentry/profiling-node, and follows a required three-file initialization pattern, needed because Sentry must patch Node.js modules through OpenTelemetry before NestJS loads. It warns against installing @sentry/node alongside @sentry/nestjs, since the latter re-exports it and installing both causes duplicate registration, and it accounts for enterprise patterns by using an injected Sentry proxy where a DI wrapper exists and by adding new options to a config class rather than hardcoding per-environment values. Detected integrations map to reference files for error monitoring, tracing, profiling, logging, metrics, crons, and AI monitoring.

FAQ

What package does it install?

@sentry/nestjs, optionally alongside @sentry/profiling-node when profiling is wanted.

Should @sentry/node be installed as well?

No, @sentry/nestjs re-exports everything from @sentry/node, and installing both causes duplicate registration.

Which NestJS versions and adapters are supported?

The APIs reflect @sentry/nestjs 10.x with NestJS 8 through 11, and both the Express default and Fastify adapters are covered, though Fastify has known edge cases.

What features can it configure?

Error monitoring and tracing are always recommended, with profiling, logging, metrics, crons, and AI monitoring added when the project shows the relevant signals.

Why does it require a three-file setup?

Because Sentry must patch Node.js modules through OpenTelemetry before NestJS loads, which the three-file initialization pattern ensures.

All Files

8 files
references/error-monitoring.md22.5 KB
View
references/logging.md4.9 KB
View
SKILL.md34.2 KB
View
references/metrics.md6.4 KB
View
references/tracing.md30.9 KB
View
references/ai-monitoring.md11.8 KB
View
references/profiling.md4.3 KB
View
references/crons.md7.1 KB
View

Install sentry-nestjs-sdk

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill