typescript-sentry

v2026.09.24

Error monitoring and performance with Sentry SDK for Bun/Node.js/Next.js — error capture, breadcrumbs, spans, cron monitoring, source maps, structured logging, profiling. Use when adding Sentry, instrumenting cron, or uploading sourcemaps.

GitHub
Install command
npx skhub add laurigates/typescript-sentry
Markdown
SKILL.md

TypeScript Sentry

This skill covers the SDK-side work: capture, spans, cron monitors, source maps, profiling, filtering. For project-level Sentry compliance (DSN hygiene, sourcemap-upload wiring in CI) use /configure:sentry; for local step-through debugging use typescript-debugging.

Core Expertise

Sentry provides error monitoring and performance tracking:

  • Automatic error capture with stack traces
  • Performance monitoring with distributed tracing
  • Cron job monitoring for scheduled tasks
  • Source map integration for readable TypeScript traces
  • Rich context with tags, breadcrumbs, and user data
  • Structured logging forwarded to Sentry (enableLogs)
  • CPU/JS profiling (Node.js + browser)
  • Session replay with privacy controls
  • User feedback widget
  • Enrichment helpers (custom contexts, breadcrumb categories, fingerprinting)

Installation

Bun

bun add @sentry/bun

Node.js

bun add @sentry/node

Next.js

bun add @sentry/nextjs @sentry/profiling-node

React/Browser

bun add @sentry/react
# or
bun add @sentry/browser

Error Capturing

captureException

try {
  await riskyOperation();
} catch (error) {
  Sentry.captureException(error);
  throw error; // Re-throw if needed
}

With Context

Sentry.captureException(error, {
  tags: {
    feature: "checkout",
    paymentProvider: "stripe",
  },
  extra: {
    orderId: order.id,
    userId: user.id,
    cartItems: cart.items.length,
  },
  level: "error", // fatal, error, warning, info, debug
});

captureMessage

// Simple message
Sentry.captureMessage("User completed onboarding");

// With level
Sentry.captureMessage("Rate limit approaching", "warning");

// With context
Sentry.captureMessage("Payment failed", {
  level: "error",
  tags: { gateway: "stripe" },
  extra: { errorCode: "card_declined" },
});

Agentic Optimizations

ContextCommand
Install Bunbun add @sentry/bun
Install Nodebun add @sentry/node
Install Next.jsbun add @sentry/nextjs @sentry/profiling-node
Install Reactbun add @sentry/react
Install CLIbun add -D @sentry/cli
Upload mapsnpx sentry-cli sourcemaps inject ./dist && npx sentry-cli sourcemaps upload ./dist
Setup wizardnpx @sentry/wizard@latest -i sourcemaps
Test captureSentry.captureMessage("Test from dev")

Quick Reference

Capture Methods

MethodPurpose
captureException(error)Capture error with stack trace
captureMessage(msg)Capture text message
captureCheckIn(opts)Cron job check-in
addBreadcrumb(crumb)Add navigation/action trail

Context Methods

MethodPurpose
setTag(key, value)Add filterable tag
setExtra(key, value)Add debug data
setUser(user)Set user context
withScope(callback)Scoped context

Performance Methods

MethodPurpose
startSpan(opts, callback)Create performance span
withMonitor(slug, callback)Monitor cron job

Severity Levels

LevelUse Case
fatalApp crash, unrecoverable
errorError requiring attention
warningPotential issue
infoInformational
debugDebugging only

Configuration Options

OptionDescription
dsnProject data source name
environmentEnvironment name (production, staging)
releaseApplication version
tracesSampleRateTransaction sample rate (0.0-1.0)
tracesSamplerDynamic sampling function
sendDefaultPiiCapture IP/headers
integrationsSDK integrations array
enableLogsForward structured logs to Sentry
profileSessionSampleRateProfiling sample rate (0.0-1.0)
profileLifecycle"trace" profiles every traced request
replaysSessionSampleRateSession replay sample rate
replaysOnErrorSampleRateReplay capture rate on errors
ignoreErrorsArray of error patterns to suppress
beforeSendFilter/modify events before sending
beforeSendTransactionFilter transactions before sending
beforeSendLogFilter structured logs before sending

For detailed examples, advanced patterns, and best practices, see REFERENCE.md.

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

MIT

Source path

typescript-plugin/skills/typescript-sentry

Default branch

main

Latest commit

1668324

Tree SHA

b2d4cc3