npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cortec/sentry

v1.7.3

Published

<description>

Readme

@cortec/sentry

Module Overview

@cortec/sentry provides integration with Sentry for error tracking and performance monitoring in Node.js applications. It wraps the official @sentry/node SDK and exposes it as a module for use within the Cortec framework, allowing centralized error reporting and release tracking.

Configuration Options

Where to put config: Place your Sentry config in config/default.yml (or your environment-specific config file).

Schema:

sentry:
  dsn: '<your-sentry-dsn>' # REQUIRED: Your Sentry project's DSN
  environment: 'production' # OPTIONAL: Environment name (e.g., "production", "staging")
  tracesSampleRate: 1.0 # OPTIONAL: Performance monitoring sample rate (0.0 - 1.0, default: 1.0)
  debug: false # OPTIONAL: Enable debug logging for Sentry SDK
  attachStacktrace: true # OPTIONAL: Attach stack traces to messages
  sendDefaultPii: false # OPTIONAL: Send personally identifiable information
  # ...any other @sentry/node options

Field-by-field explanation:

  • dsn: Required. Your Sentry project's DSN (Data Source Name). Without this, Sentry will not report errors.
  • environment: Optional. The environment name (e.g., "production", "staging", "dev"). Useful for filtering events in Sentry.
  • tracesSampleRate: Optional. Sampling rate for performance monitoring (0.0 disables, 1.0 enables all). Default is 1.0.
  • debug: Optional. If true, enables verbose debug logging for the Sentry SDK.
  • attachStacktrace: Optional. If true, attaches stack traces to captured messages.
  • sendDefaultPii: Optional. If true, sends personally identifiable information (PII) with events.
  • Any other options supported by @sentry/node.

How config is loaded: The config is loaded automatically by the @cortec/config module and passed to the Sentry SDK during initialization. The module also sets the release field to ${ctx.service.name}@${ctx.service.version} for better release tracking.

Access in code:

const config = ctx.provide<IConfig>('config');
const sentryConfig = config?.get<sentry.NodeOptions>('sentry');

If config is missing or invalid, Sentry will not initialize and errors will be logged.

Example Usage

import CortecSentry from '@cortec/sentry';

// Register the module in your Cortec context
const sentry = new CortecSentry();
context.use(sentry);

// After context.load(), you can access the Sentry API:
sentry.api.captureException(new Error('Something went wrong!'));
sentry.api.captureMessage('A warning or info message');

// Sentry will automatically report uncaught exceptions and unhandled promise rejections.

Lifecycle

  • On load, the module initializes Sentry with the provided configuration and release info.
  • On dispose, it flushes and closes the Sentry client to ensure all events are sent.

References