SE

sentry-install-auth

Streamlines Sentry error tracking setup by configuring DSN authentication for multiple platforms.

Install

mkdir -p .claude/skills/sentry-install-auth && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9313" && unzip -o skill.zip -d .claude/skills/sentry-install-auth && rm skill.zip

Installs to .claude/skills/sentry-install-auth

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Install and configure Sentry SDK authentication with DSN setup.
63 charsno explicit “when” trigger
Beginner

Key capabilities

  • Install Sentry SDK for Node.js, browser, or Python environments
  • Configure DSN-based authentication for error tracking
  • Initialize Sentry SDK with environment, release, and sample rates
  • Verify Sentry installation by sending a test event
  • Set up auth tokens for Sentry CLI and CI workflows

How it works

The skill installs the Sentry SDK, configures it with a DSN for authentication, and initializes it to send error events to the Sentry dashboard.

Inputs & outputs

You give it
Project type (Node.js, browser, Python) and Sentry DSN
You get back
Installed Sentry SDK, configured DSN, and a verified test event in Sentry dashboard

When to use sentry-install-auth

  • Install Sentry SDK in new projects
  • Configure DSN for error tracking
  • Setup authentication for Sentry CLI/CI workflows

About this skill

Sentry Install & Auth

Overview

Install the Sentry SDK, configure DSN-based authentication, and verify error tracking is operational. Covers Node.js (@sentry/node), browser (@sentry/browser), and Python (sentry-sdk) with environment-based configuration and auth token setup for CLI/CI workflows.

Prerequisites

Instructions

Step 1 — Install the SDK

Node.js / TypeScript:

npm install @sentry/node
# For profiling support (optional):
npm install @sentry/profiling-node

Browser / Framework-specific:

npm install @sentry/browser
# Or pick your framework:
npm install @sentry/react    # React
npm install @sentry/nextjs   # Next.js
npm install @sentry/vue      # Vue

Python:

pip install sentry-sdk

Step 2 — Store the DSN securely

The DSN (Data Source Name) tells the SDK where to send events. It looks like https://<key>@<org>.ingest.sentry.io/<project-id>. Never hardcode it — use environment variables.

# .env (add this file to .gitignore)
SENTRY_DSN=https://[email protected]/0
SENTRY_ENVIRONMENT=development
SENTRY_RELEASE=1.0.0

For production, store the DSN in your secret manager (AWS Secrets Manager, GCP Secret Manager, Vault, etc.) and inject it at deploy time.

Step 3 — Initialize the SDK

Node.js (ESM) — create instrument.mjs at project root:

This file MUST be imported before any other modules. The --import flag ensures Sentry instruments HTTP, database, and framework integrations via monkey-patching at load time.

// instrument.mjs — import BEFORE your app code
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.SENTRY_ENVIRONMENT || 'development',
  release: process.env.SENTRY_RELEASE,

  // Performance: 100% in dev, 10-20% in production
  tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 1.0,

  // Debug mode — disable in production
  debug: process.env.NODE_ENV !== 'production',

  // Never send PII by default
  sendDefaultPii: false,

  integrations: [
    // Built-in integrations (httpIntegration, expressIntegration)
    // are auto-detected — no manual registration needed
  ],
});

Start your app with the --import flag:

node --import ./instrument.mjs app.mjs

Or in package.json:

{
  "scripts": {
    "start": "node --import ./instrument.mjs app.mjs"
  }
}

Browser:

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: process.env.SENTRY_DSN, // injected at build time
  environment: process.env.NODE_ENV,
  release: process.env.SENTRY_RELEASE,
  tracesSampleRate: 0.1,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
});

Python:

import os
import sentry_sdk

sentry_sdk.init(
    dsn=os.environ.get("SENTRY_DSN"),
    environment=os.environ.get("SENTRY_ENVIRONMENT", "development"),
    release=os.environ.get("SENTRY_RELEASE"),
    traces_sample_rate=0.1,
    send_default_pii=False,
)

Step 4 — Verify the installation

Send a test event and confirm it appears in the Sentry dashboard:

Node.js:

import * as Sentry from '@sentry/node';

Sentry.captureMessage('Sentry SDK installed successfully', 'info');

// Ensure the event is flushed before process exits
await Sentry.flush(2000);

Python:

import sentry_sdk

sentry_sdk.capture_message("Sentry SDK installed successfully")

# Ensure the event is flushed
sentry_sdk.flush(timeout=2)

Check the Issues tab in your Sentry project within 30 seconds. If the message appears, authentication is working.

Step 5 — Set up auth token for CLI and CI

The DSN authenticates the SDK for sending events. For the Sentry CLI (source maps, releases, deploys), you need a separate auth token.

Generate one at https://sentry.io/settings/auth-tokens/ with scopes:

  • project:releases — create releases and upload source maps
  • org:read — read organization data
# Install Sentry CLI
npm install -g @sentry/cli

# Set the token
export SENTRY_AUTH_TOKEN=sntrys_YOUR_TOKEN_HERE

# Verify auth works
sentry-cli info

In CI, store SENTRY_AUTH_TOKEN as a secret environment variable.

Output

  • SDK package installed (@sentry/node, @sentry/browser, or sentry-sdk)
  • DSN stored in environment variables (never committed to git)
  • instrument.mjs created and loaded before app entry point (Node.js)
  • Sentry initialized with environment, release, and sample rates configured
  • Test event visible in Sentry dashboard confirming DSN auth works
  • Auth token configured for CLI/CI workflows (optional)

Error Handling

ErrorCauseSolution
Invalid Sentry DsnMalformed DSN stringCopy DSN exactly from Project Settings > Client Keys (DSN). Format: https://<key>@<org>.ingest.sentry.io/<project-id>
Events not appearing in dashboardDSN env var not loadedVerify with console.log(process.env.SENTRY_DSN) before Sentry.init(). Check .env is loaded (use dotenv or framework equivalent)
HTTP 401 UnauthorizedInvalid or revoked auth tokenRegenerate token at https://sentry.io/settings/auth-tokens/. Verify with sentry-cli info
HTTP 429 Too Many RequestsRate-limited by SentryLower tracesSampleRate. Check quota at Settings > Subscription. Events are dropped, not queued
Express is not instrumentedSDK initialized after Express importMove import './instrument.mjs' to first line or use --import flag. SDK must load before any framework imports
HTTP 403 ForbiddenAuth token missing required scopesRegenerate token with project:releases and org:read scopes
ECONNREFUSED / network errorsSentry ingest endpoint unreachableCheck https://status.sentry.io for outages. Verify firewall allows *.ingest.sentry.io on port 443
ESM compatibility errorNode.js < 18.19 or < 20.6Upgrade Node.js. SDK v8 requires these minimum versions for ESM --import support

Examples

Express.js with full error handler:

// instrument.mjs
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.SENTRY_ENVIRONMENT || 'development',
  tracesSampleRate: 0.2,
});
// app.mjs — start with: node --import ./instrument.mjs app.mjs
import * as Sentry from '@sentry/node';
import express from 'express';

const app = express();

app.get('/api/health', (req, res) => {
  res.json({ status: 'ok' });
});

app.get('/api/debug-sentry', (req, res) => {
  throw new Error('Sentry test error');
});

// Sentry error handler must be registered after all routes
Sentry.setupExpressErrorHandler(app);

// Fallback error handler
app.use((err, req, res, next) => {
  res.status(500).json({ error: 'Internal server error' });
});

app.listen(3000, () => console.log('Server running on :3000'));

Python Flask:

import os
import sentry_sdk
from flask import Flask

sentry_sdk.init(
    dsn=os.environ.get("SENTRY_DSN"),
    environment=os.environ.get("SENTRY_ENVIRONMENT", "development"),
    traces_sample_rate=0.2,
    send_default_pii=False,
)

app = Flask(__name__)

@app.route("/api/health")
def health():
    return {"status": "ok"}

@app.route("/api/debug-sentry")
def debug_sentry():
    raise Exception("Sentry test error")  # Automatically captured

Graceful shutdown with flush:

import * as Sentry from '@sentry/node';

process.on('SIGTERM', async () => {
  console.log('Shutting down gracefully...');
  await Sentry.flush(5000); // wait up to 5s for pending events
  process.exit(0);
});

Resources

Next Steps

For configuring alerts and issue management, see sentry-alerts-config.

When not to use it

  • When Sentry error tracking is not required for a project
  • When a project does not use Node.js, browser, or Python environments
  • When DSN or auth tokens are not available

Prerequisites

Node.js 18.19+ or 20.6+Package manager: npm, pnpm, or pipSentry account with a project created at https://sentry.ioDSN from Project Settings > Client Keys (DSN)

Limitations

  • The skill requires a Sentry account and a project created on the Sentry platform.
  • The skill's Node.js ESM support requires Node.js 18.19+ or 20.6+.
  • The skill does not cover advanced Sentry features like custom integrations or event processors.

How it compares

This skill automates the Sentry SDK installation and configuration process, which otherwise would require manual package installation, DSN setup, and initialization code.

Compared to similar skills

sentry-install-auth side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
sentry-install-auth (this skill)027dReviewBeginner
mcp-builder1363moReviewAdvanced
telegram-bot-builder1066moReviewIntermediate
stripe-integration482moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

langchain-architecture

wshobson

Design LLM applications using the LangChain framework with agents, memory, and tool integration patterns. Use when building LangChain applications, implementing AI agents, or creating complex LLM workflows.

899

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

voice-ai-development

davila7

Expert in building voice AI applications - from real-time voice agents to voice-enabled apps. Covers OpenAI Realtime API, Vapi for voice agents, Deepgram for transcription, ElevenLabs for synthesis, LiveKit for real-time infrastructure, and WebRTC fundamentals. Knows how to build low-latency, production-ready voice experiences. Use when: voice ai, voice agent, speech to text, text to speech, realtime voice.

553

Search skills

Search the agent skills registry