Sentry JavaScript SDK v10 compatibility
sentry-testkit supports Sentry JavaScript SDK v10. No code changes are required in your test setup when upgrading from Sentry v8 or v9 to v10.
What's the same
- Transport API — sentry-testkit continues to use the same custom
transportoption inSentry.init(). The envelope-based transport contract used by Sentry v7+ is unchanged in v10. - Testkit API —
testkit.reports(),testkit.transactions(),testkit.reset(), and the rest of the testkit API work the same with Sentry v10.
Sentry v10 changes (reference)
If you are upgrading your application to Sentry v10, be aware of the official migration guide. Notable changes in the SDK (none of which affect sentry-testkit usage) include:
- OpenTelemetry — All OpenTelemetry dependencies are upgraded to v2. If you rely on specific OpenTelemetry versions, review the migration guide.
- Removed FID — First Input Delay (FID) web vital is no longer reported; INP (Interaction to Next Paint) is used instead.
- Removed APIs —
BaseClient→ useClient;hasTracingEnabled→ usehasSpansEnabled;_experiments.enableLogs/beforeSendLogare now top-levelenableLogsandbeforeSendLogoptions. - User IP — As of v10.4.0, IP address collection is gated by the
sendDefaultPiiinit option.
Compatibility matrix
| sentry-testkit | Sentry JS SDK (browser / node / react) |
|---|---|
| 6.x | v8, v9, v10 |
For React Native, use @sentry/react-native with a version that matches your chosen Sentry JavaScript SDK line (see Sentry React Native docs).
Running tests with Sentry v10
Install Sentry v10 in your project and pass the testkit transport as usual:
const sentryTestkit = require('sentry-testkit')
const { testkit, sentryTransport } = sentryTestkit()
Sentry.init({
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
transport: sentryTransport,
// ... other options
})
// Your tests
expect(testkit.reports()).toHaveLength(1)
No changes are required in your test code when moving to Sentry v10.