# Sentry

> Sentry API Skill

- Skill: `ashish7802/sentry` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add ashish7802/sentry`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ashish7802/sentry/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: ashish7802 (https://skillmd.com/u/ashish7802)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/ashish7802/sentry

---

# Sentry API Skill

## Overview
Sentry tracks exceptions, traces, and crashes. This skill covers the `@sentry/node` integration for backend error capturing and the Sentry REST API for release management.

## Installation
```bash
npm install @sentry/node @sentry/profiling-node
pip install sentry-sdk
```

## Authentication
Client SDKs use a DSN (Data Source Name). The REST API uses a Bearer token generated from the Sentry Auth token settings.

## Core Concepts
- **DSN**: The ingestion endpoint URL.
- **Release**: A version of your code attached to events for regression tracking.
- **Transaction**: A logical grouping of spans for performance tracing.

## Common Workflows
1. Call `Sentry.init({ dsn })` early in the application lifecycle.
2. Wrap controllers or use framework middleware.
3. Call `Sentry.captureException(error)` for handled exceptions.

## Error Handling
The Sentry SDK fails silently on network errors so it does not crash your application.

## Security
Use the `beforeSend` hook to scrub PII (Passwords, SSNs, Auth Tokens) before the payload leaves your server.

## Rate Limits
Event ingestion is limited by your organization's quota. Exceeding it results in dropped events (HTTP 429).

## Best Practices
Always set the `release` and `environment` tags during `Sentry.init` to enable accurate issue tracking across deployments.

## Troubleshooting
If source maps aren't working, ensure the `@sentry/cli` or Webpack plugin uploaded the artifacts for the exact `release` string matching your deployed code.

## References
- [API Reference](https://docs.sentry.io/api/)

## Why use this skill
Use this when your agent works with **sentry** — structured patterns beat pasted docs and prevent common hallucinations.

## AI pitfalls
- Using outdated SDK or API versions from training data
- Inventing environment variable names
- Omitting error handling and retry logic

## Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured

## Related skills
- [`nextjs`](../nextjs/SKILL.md) — monitors
- [`express`](../express/SKILL.md) — monitors
- [`fastapi`](../fastapi/SKILL.md) — monitors

---
> **Last Verified:** 2026-07-02

