|
| 1 | +--- |
| 2 | +title: Migrate from 9.x to 10.x |
| 3 | +sidebar_order: 8880 |
| 4 | +description: "Learn about migrating from Sentry JavaScript SDK 9.x to 10.x" |
| 5 | +notSupported: |
| 6 | + - javascript.capacitor |
| 7 | + - javascript.cordova |
| 8 | + - javascript.electron |
| 9 | + - javascript.tanstackstart-react |
| 10 | +--- |
| 11 | + |
| 12 | +<PlatformSection supported={["javascript"]}> |
| 13 | +<Alert title="Using a framework?" level="info"> |
| 14 | + |
| 15 | +Make sure to select your framework in the dropdown in the top left corner of the page. |
| 16 | + |
| 17 | +</Alert> |
| 18 | +</PlatformSection> |
| 19 | + |
| 20 | +Version 10 of the Sentry JavaScript SDK primarily focuses on upgrading underlying OpenTelemetry dependencies to v2 with minimal breaking changes. |
| 21 | + |
| 22 | +Version 10 of the SDK is compatible with Sentry self-hosted versions 24.4.2 or higher (unchanged from v9). |
| 23 | +Lower versions may continue to work, but may not support all features. |
| 24 | + |
| 25 | +## Version Support Changes: |
| 26 | + |
| 27 | +Version 10 of the Sentry SDK has new compatibility ranges for runtimes and frameworks. |
| 28 | + |
| 29 | +#### Node.js |
| 30 | + |
| 31 | +All OpenTelemetry dependencies have been bumped to `2.x.x` / `0.20x.x` respectively and all OpenTelemetry instrumentations have been upgraded to their latest version. |
| 32 | + |
| 33 | +If you cannot run with OpenTelmetry v2 versions, consider either staying on Version 9 of our SDKs or using `@sentry/node-core` instead which ships with widened OpenTelemetry peer dependencies. |
| 34 | + |
| 35 | +#### AWS Lambda Layer Changes |
| 36 | + |
| 37 | +A new AWS Lambda Layer for version 10 will be published as `SentryNodeServerlessSDKv10`. |
| 38 | + |
| 39 | +Updates and fixes for version 9 will be published as `SentryNodeServerlessSDKv9`. |
| 40 | + |
| 41 | +<PlatformCategorySection supported={['browser']}> |
| 42 | + |
| 43 | +## Behavior Changes |
| 44 | + |
| 45 | +The changes outlined in this section describe in what way the SDK may behave differently after upgrading: |
| 46 | + |
| 47 | +- The SDKs no longer report the First Input Delay (FID) web vital. |
| 48 | + This was done because FID has been replaced by Interaction to Next Paint (INP) and is therefore no longer relevant for assessing and tracking a website's performance. |
| 49 | + For reference, FID has long been deprecated by Google's official `web-vitals` library and was eventually removed in version `5.0.0`. |
| 50 | + Sentry now follows Google's lead by also removing it. |
| 51 | + |
| 52 | + The removal entails **no breaking API changes**. However, in rare cases, you might need to adjust some of your Sentry SDK and product setup: |
| 53 | + |
| 54 | + - Remove any logic in `beforeSend` or other filtering/event processing logic that depends on FID or replace it with INP logic. |
| 55 | + - If you set up Sentry Alerts that depend on FID, be aware that these could trigger once you upgrade the SDK, due to a lack of new values. |
| 56 | + To replace them, adjust your alerts (or dashbaords) to use INP. |
| 57 | + |
| 58 | +</PlatformCategorySection> |
| 59 | + |
| 60 | +## Removed APIs |
| 61 | + |
| 62 | +The changes outlined in this section detail deprecated APIs that are now removed. |
| 63 | + |
| 64 | +- `BaseClient` was removed, use `Client` as a direct replacement. |
| 65 | +- `hasTracingEnabled` was removed, use `hasSpansEnabled` as a direct replacement. |
| 66 | +- `logger` and type `Logger` were removed, use `debug` and type `SentryDebugLogger` instead. |
| 67 | +- The `_experiments.enableLogs` and `_experiments.beforeSendLog` options were removed, use the top-level `enableLogs` and `beforeSendLog` options instead. |
| 68 | + |
| 69 | +```js |
| 70 | +// before |
| 71 | +Sentry.init({ |
| 72 | + _experiments: { |
| 73 | + enableLogs: true, |
| 74 | + beforeSendLog: (log) => { |
| 75 | + return log; |
| 76 | + }, |
| 77 | + }, |
| 78 | +}); |
| 79 | + |
| 80 | +// after |
| 81 | +Sentry.init({ |
| 82 | + enableLogs: true, |
| 83 | + beforeSendLog: (log) => { |
| 84 | + return log; |
| 85 | + }, |
| 86 | +}); |
| 87 | +``` |
| 88 | + |
| 89 | +## Version Support Timeline |
| 90 | + |
| 91 | +Version support timelines are stressful for everybody using the SDK, so we won't be defining one. |
| 92 | +Instead, we will be applying bug fixes and features to older versions as long as there is demand. |
| 93 | + |
| 94 | +Additionally, we hold ourselves accountable to any security issues, meaning that if any vulnerabilities are found, we will in almost all cases backport them. |
| 95 | + |
| 96 | +Note, that backporting decisions are made on a case-by-case basis. |
| 97 | +If you need a fix or feature in a previous version of the SDK, please reach out via a GitHub Issue. |
0 commit comments