sentry-sdk-upgrade

Migrate the Sentry JavaScript SDK across major versions with guided code changes.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/imrishuroy/algopatterns --skill sentry-sdk-upgrade-imrishuroy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-sdk-upgrade
Source: https://github.com/imrishuroy/algopatterns/tree/main/.agents/skills/sentry-sdk-upgrade
Command: npx skills add https://github.com/imrishuroy/algopatterns --skill sentry-sdk-upgrade-imrishuroy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Upgrading the Sentry JavaScript SDK across major versions (v7 to v8, v8 to v9) involves breaking API changes, removed packages, and renamed methods that cause build failures and runtime errors. This Skill detects your current Sentry setup and walks you through every required code change. ## Core Features & Use Cases - Automated Detection: Scans package.json and source files to identify the current Sentry version, framework (Next.js, Nuxt, SvelteKit, React, Express, NestJS, and more), and deprecated API usage via targeted grep patterns. - Phased Migration Guidance: Categorizes changes into auto-fixable renames, AI-assisted refactors (Hub removal, transaction-to-span migration), and items needing manual review, then applies them file by file. - Version-Specific References: Ships detailed migration references for v7-to-v8, v8-to-v9, and v9-to-v10 covering package removals, API renames, config changes, and behavioral differences. - Use Case: After bumping @sentry/nextjs from v8 to v9 and hitting type errors from getCurrentHub and enableTracing, use this Skill to find every occurrence, apply the replacements, update package versions, and verify the build passes. ## Quick Start Upgrade my Sentry SDK from v8 to v9 and fix all the breaking changes in my project.

Frequently Asked Questions about sentry-sdk-upgrade

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade the Sentry JavaScript SDK from v8 to v9?

Replace @sentry/utils and @sentry/types imports with @sentry/core, remove getCurrentHub usage in favor of top-level Sentry APIs, swap enableTracing for tracesSampleRate, and update all @sentry packages to the same v9 version. Then run tsc --noEmit and your build to verify.

How do I migrate Sentry from v7 to v8?

Replace removed packages like @sentry/tracing and @sentry/integrations with direct SDK imports, convert integration classes to functions such as browserTracingIntegration(), and migrate startTransaction calls to the new startSpan API. Node.js apps must also initialize Sentry before other imports.

Does the Sentry v9 SDK support Next.js and NestJS?

Yes, v9 supports Next.js 13.2+ and provides a dedicated @sentry/nestjs package. NestJS users must replace the @WithSentry decorator with @SentryExceptionCaptured and remove SentryService and SentryTracingInterceptor.

Why does my build fail after upgrading Sentry packages?

Builds typically fail because major versions remove APIs like getCurrentHub, enableTracing, and captureUserFeedback, or consolidate packages into @sentry/core. Run tsc --noEmit to list type errors, then apply the corresponding renames from the migration reference for your version jump.

Can I upgrade Sentry from v7 directly to v9?

Yes, but apply code changes incrementally: first the v7-to-v8 migration steps, then v8-to-v9, while bumping package versions once to the final target. Test after each logical step rather than waiting until all changes are made.

Does this cover Sentry SDKs for Python or Go?

No, this migration guidance covers only the Sentry JavaScript SDK and its framework packages. Other platform SDKs such as Python, Ruby, and Go require their own migration guides.