Skip to main content
Version 8 introduces major improvements to performance monitoring, OpenTelemetry integration, and a new Performance API. This guide helps you migrate from v7 to v8.

Prerequisites

Before upgrading:
  1. Upgrade to the latest v7 version first
  2. Fix all deprecation warnings
  3. Review the v8 changelog
  4. Test in a non-production environment
Version 8 requires:
  • Node.js 14.18+ for CJS, 18.19.1+ for ESM
  • Browser ES2018+ support (no IE11)
  • Next.js 13.2+
  • React 16+

Installation

Major Changes

1. Performance API Overhaul

The biggest change in v8 is the new Performance API based on OpenTelemetry.

Before (v7):

After (v8):

The new API automatically handles span finishing and error handling. Spans are automatically finished when the callback completes.

2. Package Removals

@sentry/tracing

Before (v7):
After (v8):

@sentry/integrations

Before (v7):
After (v8):

@sentry/replay

Before (v7):
After (v8):

3. Hub to Scope API

The Hub API is deprecated in favor of the new Scope API. Before (v7):
After (v8):

4. Integration Interface Changes

All integrations are now functions instead of classes. Before (v7):
After (v8):

Node.js Specific Changes

Initialization Order

In v8, Sentry MUST be initialized before any other imports. Before (v7):
After (v8):

Express Error Handler

Before (v7):
After (v8):
In v8, instrumentation happens automatically via OpenTelemetry. You only need the error handler.

Framework-Specific Migration

Next.js

v8 requires using the instrumentation hook. 1. Enable instrumentation hook (Next.js 13-14):
2. Create instrumentation.ts:
3. Update withSentryConfig: Before (v7):
After (v8):

React Router

Before (v7):
After (v8):

API Changes

Removed APIs

configureScope

Before:
After:

getActiveTransaction

Before:
After:

spanStatusfromHttpCode

Before:
After:

Behavior Changes

tracePropagationTargets

In v7, tracePropagationTargets defaulted to ['localhost', /^\/(?!\/)/]. In v8, it defaults to same-origin requests only. Migration:

Severity Enum

Before:
After:

Step-by-Step Migration

1. Update Dependencies

2. Update Imports

3. Update Integrations

4. Update Performance Code

5. Update Scope Usage

6. Test Thoroughly

  1. Test error capturing
  2. Test performance monitoring
  3. Verify source maps
  4. Check integrations

Migration Checklist

  • Update all @sentry/* packages to v8
  • Remove deprecated packages (@sentry/tracing, @sentry/integrations, @sentry/replay)
  • Update integration syntax (class → function)
  • Replace startTransaction with startSpan
  • Replace configureScope with getCurrentScope()
  • Update Next.js to use instrumentation hook
  • Update Node.js initialization order
  • Test in staging environment
  • Update source map configuration
  • Review and test all custom instrumentation

Automated Migration

Sentry provides a migration tool:
This tool automatically updates:
  • Integration syntax
  • Import statements
  • Performance API calls
  • Scope API usage
Always review the automated changes before committing. Test thoroughly!

Getting Help

If you encounter issues:
  1. Check the full v8 migration guide
  2. Search GitHub issues
  3. Ask in Discord
  4. Review the v8 changelog

Next Steps

v8 to v10 Migration

Upgrade from v8 to the latest version

Performance Monitoring

Learn the new Performance API