Sentry SDK v7 → Sentry SDK v8
mediumSentry v8 brings OpenTelemetry integration, smaller bundle, and auto-instrumentation. Init order matters — v8 is strict about it.
npm install @sentry/node@latest @sentry/browser@latest
Sentry.init() must be the FIRST thing that runs. Use --require or instrumentation.ts.
// instrumentation.ts (Next.js)
import * as Sentry from '@sentry/nextjs'
Sentry.init({ dsn: process.env.SENTRY_DSN })setupOnce() removed. Use setup() and processEvent() instead. Check the migration guide.
Sentry.configureScope() → Sentry.withScope(). Hub.run() removed. getCurrentScope() is the new API.
What this migration involves
Moving from Sentry SDK v7 to Sentry SDK v8 is rated medium and takes about 2-4h on a typical project. The guide breaks it into 5 steps, 2 of which ship with runnable commands and 1 with a verification check.
FAQ
How long does migrating from Sentry SDK v7 to Sentry SDK v8 take?
Around 2-4h for a typical project — 5 steps, difficulty rated medium, 2 of them with copy-paste commands.
Is moving from Sentry SDK v7 to Sentry SDK v8 reversible?
No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Sentry SDK v7 data before you start.
What does Sentry SDK v8 cost compared to Sentry SDK v7?
Pricing for both tools is contact-based or not tracked yet.