
Sentry Sdk Upgrade
Upgrade @sentry JavaScript SDK packages across major versions without missing framework-specific config files or breaking imports.
Overview
Sentry SDK Upgrade is an agent skill for the Operate phase that finds all Sentry JavaScript SDK usage and framework config entry points so you can upgrade @sentry packages across major versions safely.
Install
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-sdk-upgradeWhat is this skill?
- Grep patterns to locate every @sentry import across TS/JS/TSX/JSX and ESM/CJS extensions
- Find commands for sentry.*, *.sentry.*, and instrumentation.* config files while excluding node_modules
- package.json and node_modules checks to read declared versus installed @sentry versions
- Framework reference table for client, server, build, and edge config paths across Next.js, Nuxt, SvelteKit, Remix, React
- Version-agnostic upgrade guidance applicable to any major Sentry JavaScript SDK release
- Seven-framework reference table for client, server, build, and edge Sentry config locations
- Grep recipe covers six common JS/TS source extensions plus ESM and CJS modules
Adoption & trust: 1.5k installs on skills.sh; 197 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to bump @sentry/* to a new major release but are unsure which config files, hooks, and imports across Next.js, Nuxt, or other stacks still target the old SDK surface.
Who is it for?
Solo builders maintaining a TS/JS app that already reports errors to Sentry and planning a major SDK version jump.
Skip if: Greenfield projects with no Sentry installed yet, or teams that only need Sentry dashboard triage without touching repository code.
When should I use this skill?
Upgrading @sentry/* JavaScript SDK packages across any major version or auditing where Sentry is initialized in a TS/JS monorepo or app.
What do I get? / Deliverables
You get a repeatable inventory of imports, config paths, and installed versions mapped to your framework layout, ready to apply Sentry’s migration steps file by file.
- List of @sentry import sites and config filenames to edit for the target SDK version
- Documented current versus declared @sentry package versions from package.json and node_modules
Recommended Skills
Journey fit
SDK upgrades are maintenance on an existing observability stack in production apps, not greenfield idea or launch work. Sentry is error and performance monitoring; bumping SDK versions belongs on the monitoring shelf with other production telemetry upkeep.
How it compares
Use this procedural repo-audit skill instead of guessing config filenames from memory or scrolling generic npm upgrade tutorials.
Common Questions / FAQ
Who is Sentry SDK Upgrade for?
It is for solo and indie developers who own a JavaScript or TypeScript codebase already integrated with Sentry and need agent-guided discovery before a major SDK upgrade.
When should I use Sentry SDK Upgrade?
Use it in Operate when refreshing monitoring dependencies, after security or support deadlines for an old @sentry version, or during Build/Ship when a framework migration forces Sentry config moves—always before you merge a blind package.json bump.
Is Sentry SDK Upgrade safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and confirm suggested shell commands before running them in production repos.
SKILL.md
READMESKILL.md - Sentry Sdk Upgrade
# Sentry SDK Upgrade — General Patterns Version-agnostic guidance for upgrading the Sentry JavaScript SDK across any major version. ## Finding Sentry Code in a Project ### Grep for All Sentry Imports ```bash grep -rn "from '@sentry/\|require('@sentry/" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" --include="*.cjs" ``` ### Find Sentry Config Files ```bash # Common config file patterns find . -name "sentry.*" -o -name "*.sentry.*" -o -name "instrumentation.*" | grep -v node_modules | grep -v .next ``` ### Check Current Sentry Version ```bash # npm/yarn cat package.json | grep -E '"@sentry/' | head -20 # Actual installed version ls node_modules/@sentry/*/package.json 2>/dev/null | head -5 | xargs -I{} sh -c 'echo "--- {} ---" && grep "\"version\"" {}' ``` ## Common Config File Locations by Framework | Framework | Client Config | Server Config | Build Config | Other | |---|---|---|---|---| | **Next.js** | `instrumentation-client.ts` | `sentry.server.config.ts` | `next.config.ts` (wrapped with `withSentryConfig`) | `instrumentation.ts`, `sentry.edge.config.ts` | | **Nuxt** | `sentry.client.config.ts` | `sentry.server.config.ts` | `nuxt.config.ts` | — | | **SvelteKit** | `src/hooks.client.ts` | `src/hooks.server.ts` | `vite.config.ts` | — | | **Remix** | `entry.client.tsx` | `entry.server.tsx` | — | — | | **React (SPA)** | `src/index.tsx` or `src/main.tsx` | — | — | — | | **Angular** | `src/main.ts` | — | — | — | | **Vue** | `src/main.ts` | — | — | — | | **Express/Node** | — | `app.ts` or `server.ts` | — | `instrument.ts` | | **NestJS** | — | `main.ts` | — | `instrument.ts` | | **Astro** | `astro.config.mjs` | — | — | — | ## Package Manager Commands for Version Bumps ### npm ```bash # Upgrade all @sentry packages to latest npm install @sentry/browser@latest @sentry/node@latest # list all packages # Or use npm-check-updates npx npm-check-updates -f '@sentry/*' -u && npm install ``` ### yarn ```bash # Upgrade all @sentry packages yarn add @sentry/browser@latest @sentry/node@latest # list all packages # Or use yarn upgrade-interactive yarn upgrade-interactive --latest ``` ### pnpm ```bash # Upgrade all @sentry packages pnpm update @sentry/browser@latest @sentry/node@latest # list all packages # Or update all Sentry packages at once pnpm update '@sentry/*' --latest ``` ## Validation Steps After Upgrade ### 1. Install Dependencies ```bash # Remove lockfile and node_modules for clean install (if needed) rm -rf node_modules npm install # or yarn / pnpm install ``` ### 2. Check for Type Errors ```bash npx tsc --noEmit ``` ### 3. Run Tests ```bash npm test # or yarn test / pnpm test ``` ### 4. Build the Project ```bash npm run build # or yarn build / pnpm build ``` ### 5. Verify Sentry Is Working Add a test error to verify events reach Sentry: ```js // Temporarily add to any entry point setTimeout(() => { throw new Error('Sentry SDK upgrade test - safe to delete'); }, 3000); ``` Check the Sentry dashboard for the test error, then remove it. ## Framework-Specific Upgrade Considerations ### Next.js - Check both client and server Sentry configs - Verify `withSentryConfig` wrapper in `next.config.ts` - Ensure `instrumentation.ts` exists and loads Sentry server config - Test both dev and production builds (`next dev` and `next build`) - Check source maps upload in production build output ### Nuxt - Sentry module config in `nuxt.config.ts` may need updating - Check both client and server plugin files - Verify source maps configuration ### SvelteKit - Check `sentryHandle()` in hooks files - Verify Vite plugin configuration - Check `sentryHandleError()` setup ### React (SPA) - Verify browser tracing integration - Check React Router integration version compatibility - Test error boundary components ### Express/Node - Ensure Sentry is initialized before other imports (v8+) - Verify error handler placement (`setupExpressErrorHandler`) - Check custom middlewa