sentry-sdk-upgrade
This skill guides agents through upgrading the Sentry JavaScript SDK across major versions by detecting current setup, recommending a migration path, and…
Identity proven by GitHub's verified organisation badge (getsentry)
- Agents
- Claude Code
- License
- Apache-2.0 (permissive)
- Pin
- d8fd106pinned Oct 9, 2026
- Context cost
- about 2,100 tokenswhen the skill loads
- GitHub stars
- 268on getsentry/sentry-for-ai
- Scripts
- None found
What it does
“Upgrade the Sentry JavaScript SDK across major versions. Use when asked to upgrade Sentry, migrate to a newer version, fix deprecated Sentry APIs, or resolve breaking changes after a Sentry version bump.”
Generated summary from the skill's own text
This skill guides agents through upgrading the Sentry JavaScript SDK across major versions by detecting current setup, recommending a migration path, and applying version-specific breaking changes. It handles single and multi-hop migrations across frameworks like Next.js, React, Vue, Node.js, and others, categorizing changes as auto-fixable, AI-assisted, or requiring manual review.
When to use it
- User asks to upgrade Sentry or migrate to a newer SDK version
- Deprecated Sentry APIs or breaking changes appear after version bump
- Moving between major versions like v7 to v8 or v8 to v9
- Errors occur after updating @sentry package versions
When not to
- Upgrading Sentry SDKs for non-JavaScript languages like Python or Go
- User prefers automated CLI tools like @sentry/wizard over guided migration
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgradeInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install getsentry/sentry-for-ai sentry-sdk-upgrade@d8fd106782e609625704f5348b25c43b2f5dbeffInstalls the commit we checked (d8fd106).
Copy by hand
Download the folder at d8fd106 and put it in .claude/skills/sentry-sdk-upgrade for Claude Code and in .agents/skills/sentry-sdk-upgrade for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install sentry@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install sentry-cli@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "sentry-sdk-upgrade" by Sentry. Source, pinned to commit d8fd106782e609625704f5348b25c43b2f5dbeff: https://github.com/getsentry/sentry-for-ai/tree/d8fd106782e609625704f5348b25c43b2f5dbeff/skills-legacy/sentry-sdk-upgrade 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/sentry-sdk-upgrade/ for Claude Code and .agents/skills/sentry-sdk-upgrade/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/sentry/sentry-sdk-upgrade
SKILL.md at the pin
---
name: sentry-sdk-upgrade
description: Upgrade the Sentry JavaScript SDK across major versions. Use when asked to upgrade Sentry, migrate to a newer version, fix deprecated Sentry APIs, or resolve breaking changes after a Sentry version bump.
license: Apache-2.0
category: workflow
parent: sentry-workflow
disable-model-invocation: true
---
> [All Skills](../../SKILL_TREE.md) > [Workflow](../sentry-workflow/SKILL.md) > SDK Upgrade
# Sentry JavaScript SDK Upgrade
Upgrade the Sentry JavaScript SDK across major versions with AI-guided migration.
## Invoke This Skill When
- User asks to "upgrade Sentry" or "migrate Sentry SDK"
- User mentions deprecated Sentry APIs or breaking changes after a version bump
- User wants to move from v7 to v8, v8 to v9, or any major version jump
- User encounters errors after updating `@sentry/*` package versions
- User asks about Sentry migration guides or changelogs
## Phase 1: Detect
Identify the current Sentry SDK version, target version, and framework.
### 1.1 Read package.json
```bash
cat package.json | grep -E '"@sentry/' | head -20
```
Extract:
- All `@sentry/*` packages and their current versions
- The current major version (e.g., `7.x`, `8.x`, `9.x`)
### 1.2 Detect Framework
Check `package.json` dependencies for framework indicators:
| Dependency | Framework | Sentry Package |
|---|---|---|
| `next` | Next.js | `@sentry/nextjs` |
| `nuxt` or `@nuxt/kit` | Nuxt | `@sentry/nuxt` |
| `@sveltejs/kit` | SvelteKit | `@sentry/sveltekit` |
| `@remix-run/node` | Remix | `@sentry/remix` |
| `react` (no Next/Remix) | React SPA | `@sentry/react` |
| `@angular/core` | Angular | `@sentry/angular` |
| `vue` (no Nuxt) | Vue | `@sentry/vue` |
| `express` | Express | `@sentry/node` |
| `@nestjs/core` | NestJS | `@sentry/nestjs` |
| `@solidjs/start` | SolidStart | `@sentry/solidstart` |
| `astro` | Astro | `@sentry/astro` |
| `bun` types or runtime | Bun | `@sentry/bun` |
| `@cloudflare/workers-types` | Cloudflare | `@sentry/cloudflare` |
| None of above (Node.js) | Node.js | `@sentry/node` |
### 1.3 Find Sentry Config Files
```bash
grep -rn "from '@sentry/\|require('@sentry/" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" --include="*.cjs" -l
```
```bash
find . -name "sentry.*" -o -name "*.sentry.*" -o -name "instrumentation.*" | grep -v node_modules | grep -v .next | grep -v .nuxt
```
### 1.4 Detect Deprecated Patterns
Scan for patterns that indicate which migration steps are needed:
```bash
# v7 patterns (need v7→v8 migration)
grep -rn "from '@sentry/hub'\|from '@sentry/tracing'\|from '@sentry/integrations'\|from '@sentry/serverless'\|from '@sentry/replay'" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" -l
grep -rn "new BrowserTracing\|new Replay\|startTransaction\|configureScope\|Handlers\.requestHandler\|Handlers\.errorHandler" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" -l
# v8 patterns (need v8→v9 migration)
grep -rn "from '@sentry/utils'\|from '@sentry/types'" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" -l
grep -rn "getCurrentHub\|enableTracing\|captureUserFeedback\|@WithSentry\|autoSessionTracking" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" -l
```
### 1.5 Determine Target Version
If the user didn't specify a target version, recommend the latest major version (v9 as of this writing). If the user has already bumped package versions but has broken code, detect the target from `package.json`.
## Phase 2: Recommend
Present a migration summary based on detected state.
### 2.1 Calculate Migration Path
- **Single hop**: e.g., v8 to v9
- **Multi-hop**: e.g., v7 to v9 (apply v7→v8 changes first, then v8→v9)
For multi-hop migrations, apply code changes incrementally but update package versions once to the final target.
### 2.2 Present Breaking Changes Summary
Load the appropriate version-specific reference:
- v7→v8: [references/v7-to-v8.md](references/v7-to-v8.md)
- v8→v9: [references/v8-to-v9.md](references/v8-to-v9.md)
- v9→v10: [references/v9-to-v10.md](references/v9-to-v10.md)
Present a concrete summary of changes needed, categorized by complexity:
**Auto-fixable** (apply directly):
- Package import renames (e.g., `@sentry/utils` to `@sentry/core`)
- Simple method renames (e.g., `@WithSentry` to `@SentryExceptionCaptured`)
- Config option swaps (e.g., `enableTracing` to `tracesSampleRate`)
**AI-assisted** (explain and propose):
- Hub removal with variable storage patterns
- Performance API migration (transactions to spans)
- Complex config restructuring (Vue tracing options, Next.js config merging)
- Sampler `transactionContext` flattening
**Manual review** (flag for user):
- Removed APIs with no equivalent
- Behavioral changes (sampling, source maps defaults)
- Custom transport modifications
### 2.3 Confirm Scope
Ask the user:
- Confirm the migration path (e.g., "v8 to v9")
- Confirm whether to proceed with all changes or specific categories
- Note: `npx @sentry/wizard -i upgrade` exists as a CLI alternative for v8→v9 but may not handle all patterns
## Phase 3: Guide
Step through changes file by file.
### 3.1 Process Each File with Sentry Imports
For each file identified in Phase 1.3:
1. **Read the file** to understand current Sentry usage
2. **Apply auto-fixable changes** directly:
- Package import renames
- Method/function renames
- Simple config option swaps
3. **For AI-assisted changes**, explain what needs to change and why, then propose the specific edit
4. **For uncertain changes**, show the code and ask the user to confirm
### 3.2 Apply Changes by Category
Work through changes in this order:
#### Step 1: Package Import Updates
Replace removed/renamed package imports. Reference the version-specific migration file for the complete mapping.
#### Step 2: API Renames
Apply mechanical method and function renames.
#### Step 3: Config Changes
Update `Sentry.init()` options and build configuration.
#### Step 4: Complex Pattern Migration
Handle patterns requiring understanding of context:
- Hub usage stored in variables
- Transaction-based performance code
- Custom integration classes
- Framework-specific wrappers
#### Step 5: Update package.json Versions
Update all `@sentry/*` packages to the target version. All packages must be on the same major version.
```bash
# Detect package manager
if [ -f "yarn.lock" ]; then
echo "yarn"
elif [ -f "pnpm-lock.yaml" ]; then
echo "pnpm"
else
echo "npm"
fi
```
Install updated dependencies using the detected package manager.
#### Step 6: Verify Build
```bash
# Check for type errors
npx tsc --noEmit 2>&1 | head -50
# Run build
npm run build 2>&1 | tail -20
```
Fix any remaining type errors or build failures.
### 3.3 Framework-Specific Steps
Consult [references/upgrade-patterns.md](references/upgrade-patterns.md) for framework-specific config file locations and validation steps.
**Next.js**: Check `instrumentation.ts`, `next.config.ts` wrapper, both client and server configs.
**Nuxt**: Check Nuxt module config and both plugin files.
**SvelteKit**: Check hooks files and Vite config.
**Express/Node**: Verify early initialization order.
**NestJS**: Check for decorator and filter renames.
## Phase 4: Cross-Link
### 4.1 Verify
- [ ] All `@sentry/*` packages on same version
- [ ] No import errors from removed packages
- [ ] TypeScript compilation passes
- [ ] Build succeeds
- [ ] Tests pass (if they exist)
Suggest adding a test error:
```js
// Add temporarily to verify Sentry is working after upgrade
setTimeout(() => {
throw new Error('Sentry upgrade verification - safe to delete');
}, 3000);
```
### 4.2 New Features in Target Version
Mention features available in the new version that the user might want to enable:
**v8 new features**: OpenTelemetry-based Node tracing, automatic database/HTTP instrumentation, functional integrations, new span APIs
**v9 new features**: Structured logging (`Sentry.logger.*`), improved source maps handling, simplified configuration
### 4.3 Related Resources
- [Official Migration Guide (v7→v8)](https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/)
- [Official Migration Guide (v8→v9)](https://docs.sentry.io/platforms/javascript/migration/v8-to-v9/)
- [Sentry JavaScript SDK Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
If the user has other Sentry SDKs (Python, Ruby, Go, etc.) that also need upgrading, note that this skill covers JavaScript SDK only.
From getsentry/sentry-for-ai at d8fd106, shown as plain text under its license: Apache-2.0 (permissive). The license text is in skills-legacy/sentry-sdk-upgrade/SKILL.md.
View SKILL.md on GitHub at d8fd106Files
- SKILL.md8.6 KB · 3573b864d6a5
- references/
- upgrade-patterns.md5.4 KB · 25e7022e30c8
- v7-to-v8.md9.2 KB · 412f3bd09a9d
- v8-to-v9.md11 KB · d0d0ae330b65
- v9-to-v10.md1.2 KB · 1e30fff3c5ca
5 files, 35 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at d8fd106More from Sentry
claude-settings-audit
This skill analyzes a repository to detect its tech stack, build tools, and service integrations, then generates recommended Claude Code settings.json…
Claude Code · about 2.9K tokens · pinned 6 days ago
commit
This skill enables the agent to create conventional commit messages following Sentry's style guide.
Claude Code, Codex, Cursor +4 · about 430 tokens · pinned 6 days ago
django-access-review
This skill guides agents through investigating Django and Django REST Framework code for IDOR and access control vulnerabilities.
Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago
django-perf-review
This skill audits Django codebases for performance problems by validating issues through code tracing before reporting.
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago
iterate-pr
This skill automates PR iteration by fetching CI check statuses and review feedback, then fixing actionable failures and high/medium priority comments until…
Contains scripts
Claude Code · about 1.2K tokens · pinned 6 days ago
pr-writer
This skill helps agents write clear, reviewer-focused PR titles and descriptions by inspecting the branch, diff, and existing PR state, then crafting concise…
Claude Code, Codex, Cursor +4 · about 1.3K tokens · pinned 6 days ago
Related in Observability
triage-frontend-issues
This skill automatically archives non-actionable issues from the Sentry JavaScript project by classifying them against defined noise categories and applying…
by SentryOfficial publisher
Claude Code · about 1.9K tokens · pinned 6 days ago
sentry
This skill queries Sentry telemetry data, creates alerts and monitors when explicitly requested, and generates deep links to Sentry dashboards.
by SentryOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
sentry-android-sdk
Guides you through installing and configuring the Sentry Android SDK for error monitoring, tracing, profiling, session replay, and logging in Kotlin and Java…
by SentryOfficial publisher
Claude Code · about 7.6K tokens · pinned 6 days ago
sentry-browser-sdk
Sets up the Sentry SDK for browser JavaScript projects using vanilla JS, jQuery, static sites, or WordPress without a framework-specific SDK.
by SentryOfficial publisher
Claude Code · about 6.4K tokens · pinned 6 days ago
sentry-cloudflare-sdk
Guides setup of Sentry error monitoring, tracing, logging, and crons monitoring for Cloudflare Workers, Pages, Durable Objects, and Hono applications.
by SentryOfficial publisher
Claude Code · about 5.2K tokens · pinned 6 days ago
sentry-cocoa-sdk
Sets up comprehensive monitoring for iOS, macOS, tvOS, watchOS, and visionOS apps using the Sentry Cocoa SDK.
by SentryOfficial publisher
Claude Code · about 5.3K tokens · pinned 6 days ago