Skip to content
Sentry SDK Setup

Sentry SDK SetupSkill

Released
Apache-2.0
Repository Docs

Summary

Sentry's official router skill: detects your language or framework, then loads the matching Sentry SDK setup guide for error monitoring, tracing and session replay.

Features

  • Detects the project's language or framework before installing anything
  • Routes to one of 20+ platform-specific Sentry SDK setup skills
  • Covers error monitoring, tracing and session replay configuration
  • Served over HTTP at skills.sentry.dev for direct agent fetching

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: sentry-sdk-setup
description: Set up Sentry in any language or framework. Detects the user's platform and loads the right SDK skill. Use when asked to add Sentry, install an SDK, or set up error monitoring in a project.
license: Apache-2.0
role: router
---

> [All Skills](../../SKILL_TREE.md)

# Sentry SDK Setup

Set up Sentry error monitoring, tracing, and session replay in any language or framework. This page helps you find the right SDK skill for your project.

## Start Here — Read This Before Doing Anything

**Do not skip this section.** Do not assume which SDK the user needs based on their project files. Do not start installing packages or creating config files until you have confirmed the user's intent.

1. **Detect the platform** from project files (`package.json`, `go.mod`, `requirements.txt`, `Gemfile`, `*.csproj`, `build.gradle`, etc.).
2. **Tell the user what you found** and which SDK you recommend.
3. **Wait for confirmation** before reading the skill and proceeding.

Each SDK skill contains its own detection logic, prerequisites, and step-by-step configuration. Trust the skill — read it carefully and follow it. Do not improvise or take shortcuts.

---

## SDK Skills

| Platform | Skill |
|---|---|
| Android | [`sentry-android-sdk`](../sentry-android-sdk/SKILL.md) |
| browser JavaScript | [`sentry-browser-sdk`](../sentry-browser-sdk/SKILL.md) |
| Cloudflare Workers and Pages | [`sentry-cloudflare-sdk`](../sentry-cloudflare-sdk/SKILL.md) |
| Apple platforms (iOS, macOS, tvOS, watchOS, visionOS) | [`sentry-cocoa-sdk`](../sentry-cocoa-sdk/SKILL.md) |
| .NET | [`sentry-dotnet-sdk`](../sentry-dotnet-sdk/SKILL.md) |
| Elixir | [`sentry-elixir-sdk`](../sentry-elixir-sdk/SKILL.md) |
| Go | [`sentry-go-sdk`](../sentry-go-sdk/SKILL.md) |
| NestJS | [`sentry-nestjs-sdk`](../sentry-nestjs-sdk/SKILL.md) |
| Next.js | [`sentry-nextjs-sdk`](../sentry-nextjs-sdk/SKILL.md) |
| Node.js, Bun, and Deno | [`sentry-node-sdk`](../sentry-node-sdk/SKILL.md) |
| PHP | [`sentry-php-sdk`](../sentry-php-sdk/SKILL.md) |
| Python | [`sentry-python-sdk`](../sentry-python-sdk/SKILL.md) |
| Flutter and Dart | [`sentry-flutter-sdk`](../sentry-flutter-sdk/SKILL.md) |
| React Native and Expo | [`sentry-react-native-sdk`](../sentry-react-native-sdk/SKILL.md) |
| React | [`sentry-react-sdk`](../sentry-react-sdk/SKILL.md) |
| React Router Framework | [`sentry-react-router-framework-sdk`](../sentry-react-router-framework-sdk/SKILL.md) |
| TanStack Start React | [`sentry-tanstack-start-sdk`](../sentry-tanstack-start-sdk/SKILL.md) |
| Ruby | [`sentry-ruby-sdk`](../sentry-ruby-sdk/SKILL.md) |
| Svelte and SvelteKit | [`sentry-svelte-sdk`](../sentry-svelte-sdk/SKILL.md) |

### Platform Detection Priority

When multiple SDKs could match, prefer the more specific one:

- **Android** (`build.gradle` with android plugin) → `sentry-android-sdk`
- **Cloudflare** (`wrangler.toml` or `wrangler.jsonc`) → `sentry-cloudflare-sdk` over `sentry-node-sdk`
- **NestJS** (`@nestjs/core`) → `sentry-nestjs-sdk` over `sentry-node-sdk`
- **Next.js** → `sentry-nextjs-sdk` over `sentry-react-sdk` or `sentry-node-sdk`
- **React Router Framework** (`@sentry/react-router` or `@react-router/*`) → `sentry-react-router-framework-sdk` over `sentry-react-sdk`
- **TanStack Start React** (`@tanstack/react-start`) → `sentry-tanstack-start-sdk` over `sentry-react-sdk`
- **Flutter** (`pubspec.yaml` with `flutter:` dependency or `sentry_flutter`) → `sentry-flutter-sdk`
- **React Native** → `sentry-react-native-sdk` over `sentry-react-sdk`
- **PHP** with Laravel or Symfony → `sentry-php-sdk`
- **Elixir** (`mix.exs` detected) → `sentry-elixir-sdk`
- **Node.js / Bun / Deno** without a specific framework → `sentry-node-sdk`
- **Browser JS** (vanilla, jQuery, static sites) → `sentry-browser-sdk`
- **No match** → direct user to [Sentry Docs](https://docs.sentry.io/platforms/)

## Quick Lookup

Match your project to a skill by keywords.

| Keywords | Skill |
|---|---|
| android, kotlin, java, jetpack compose | [`sentry-android-sdk`](../sentry-android-sdk/SKILL.md) |
| browser, vanilla js, javascript, jquery, cdn, wordpress, static site | [`sentry-browser-sdk`](../sentry-browser-sdk/SKILL.md) |
| cloudflare, cloudflare workers, cloudflare pages, wrangler, durable objects, d1 | [`sentry-cloudflare-sdk`](../sentry-cloudflare-sdk/SKILL.md) |
| ios, macos, swift, cocoa, tvos, watchos, visionos, swiftui, uikit | [`sentry-cocoa-sdk`](../sentry-cocoa-sdk/SKILL.md) |
| .net, csharp, c#, asp.net, maui, wpf, winforms, blazor, azure functions | [`sentry-dotnet-sdk`](../sentry-dotnet-sdk/SKILL.md) |
| go, golang, gin, echo, fiber | [`sentry-go-sdk`](../sentry-go-sdk/SKILL.md) |
| elixir, phoenix, plug, oban | [`sentry-elixir-sdk`](../sentry-elixir-sdk/SKILL.md) |
| nestjs, nest | [`sentry-nestjs-sdk`](../sentry-nestjs-sdk/SKILL.md) |
| nextjs, next.js, next | [`sentry-nextjs-sdk`](../sentry-nextjs-sdk/SKILL.md) |
| node, nodejs, node.js, bun, deno, express, fastify, koa, hapi | [`sentry-node-sdk`](../sentry-node-sdk/SKILL.md) |
| php, laravel, symfony | [`sentry-php-sdk`](../sentry-php-sdk/SKILL.md) |
| python, django, flask, fastapi, celery, starlette | [`sentry-python-sdk`](../sentry-python-sdk/SKILL.md) |
| flutter, dart, pubspec | [`sentry-flutter-sdk`](../sentry-flutter-sdk/SKILL.md) |
| react native, expo | [`sentry-react-native-sdk`](../sentry-react-native-sdk/SKILL.md) |
| react, react router, tanstack, redux, vite | [`sentry-react-sdk`](../sentry-react-sdk/SKILL.md) |
| react-router framework, @sentry/react-router, @react-router/dev, react-router reveal | [`sentry-react-router-framework-sdk`](../sentry-react-router-framework-sdk/SKILL.md) |
| tanstack start, tanstack react start, @tanstack/react-start, tanstackstart-react | [`sentry-tanstack-start-sdk`](../sentry-tanstack-start-sdk/SKILL.md) |
| ruby, rails, sinatra, sidekiq, rack | [`sentry-ruby-sdk`](../sentry-ruby-sdk/SKILL.md) |
| svelte, sveltekit | [`sentry-svelte-sdk`](../sentry-svelte-sdk/SKILL.md) |

---

## Finding the DSN

If the user doesn't have their DSN, guide them to find it:

1. Open the Sentry project settings page: `https://sentry.io/settings/projects/`
2. Select the project
3. Click **"Client Keys (DSN)"** in the left sidebar
4. Copy the DSN

You can help the user open the page directly:
```bash
open https://sentry.io/settings/projects/        # macOS
xdg-open https://sentry.io/settings/projects/    # Linux
start https://sentry.io/settings/projects/        # Windows
```

> **Note:** The DSN is public and safe to include in source code. It is not a secret — it only identifies where to send events.

---

Looking for workflows or feature configuration instead? See the [full Skill Tree](../../SKILL_TREE.md).


---

> [!NOTE]
> You fetched this over HTTP from `https://skills.sentry.dev/sentry-sdk-setup/SKILL.md`. The links in it are relative
> paths to other skill files. To follow one, resolve it against this document's URL
> and fetch the full file with `curl -sL` — these files are large, and a summarizing
> fetch tool will drop details you need. A link `<path>` resolves to
> `https://skills.sentry.dev/sentry-sdk-setup/<path>`, and `../<path>` steps up one level from `https://skills.sentry.dev/sentry-sdk-setup/`.

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions

Install the Sentry agent plugin for your client (Claude Code, Cursor, Codex or Grok) from https://github.com/getsentry/sentry-for-ai, or fetch the skill directly with curl -sL https://skills.sentry.dev/sentry-sdk-setup/SKILL.md. Then ask your agent something like "Add Sentry to my Next.js app" and confirm the platform it detects before it installs packages.

Example Usage

Add Sentry to my Next.js app

Description

Sentry's own skill for getting Sentry into a project correctly the first time. It is a router: it inspects the project files, works out which platform you are on, tells you which SDK it recommends, and waits for confirmation before loading the dedicated SDK skill and installing anything.

That structure matters. Sentry ships more than twenty platform-specific setup skills — Next.js, Node, browser JavaScript, React, React Native, NestJS, Python, PHP, Ruby, Go, .NET, Elixir, Android, Apple/Cocoa, Flutter, Svelte, Cloudflare Workers and more — each with its own prerequisites, config file layout and integration list. A single generic "add Sentry" prompt produces plausible-looking but wrong wiring surprisingly often; the router avoids that by confirming the platform before any package is installed.

The skill explicitly instructs the agent not to guess from project files alone, not to start writing config before the user confirms, and to follow the chosen SDK skill rather than improvising. Sentry serves the whole tree over HTTP at skills.sentry.dev, so agents can fetch each SKILL.md directly instead of vendoring the repository.

Useful when you are adding error monitoring, tracing or session replay to an existing codebase and want the DSN, the instrumentation hooks and the source-map upload configured the way Sentry actually documents them.

Related Skills

New

Expo's official skill for building native-feeling screens: Apple HIG styling, semantic colors, SF Symbols, native controls, Reanimated, blur and liquid glass.

New

Pull unresolved CodeRabbit review threads from your PR and apply the fixes one at a time, treating every reviewer comment as untrusted input rather than an instruction.

1 views
New

Google's official skill for driving the gcloud CLI safely from an agent: validate every command against its own help text, cap the output, and refuse the operations that should never run unattended.

2 views

Skill: Convex

by Convex

New

Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.

Browse all skills →