Skip to content

Commit a1313a6

Browse files
authored
feat(angular): Update SDK provider setup for Angular 19 (#11921)
1 parent e4cffea commit a1313a6

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

platform-includes/getting-started-config/javascript.angular.mdx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,36 @@ platformBrowserDynamic()
8787

8888
The Sentry Angular SDK exports a couple of Angular providers that are necessary to fully instrument your application. We recommend registering them in your `app.config.ts` or main `app.module.ts`:
8989

90-
```typescript {tabTitle: App Config} {filename: app.config.ts} {8, 13-26} {"onboardingOptions": {"performance": "17-26"}}
90+
```typescript {tabTitle: App Config (Angular 19+)} {filename: app.config.ts} {9, 14-24} {"onboardingOptions": {"performance": "18-24"}}
91+
import {
92+
ApplicationConfig,
93+
ErrorHandler,
94+
inject,
95+
provideAppInitializer,
96+
} from "@angular/core";
97+
import { Router } from "@angular/router";
98+
99+
import * as Sentry from "@sentry/angular";
100+
101+
export const appConfig: ApplicationConfig = {
102+
providers: [
103+
// ...
104+
{
105+
provide: ErrorHandler,
106+
useValue: Sentry.createErrorHandler(),
107+
},
108+
{
109+
provide: Sentry.TraceService,
110+
deps: [Router],
111+
},
112+
provideAppInitializer(() => {
113+
inject(TraceService);
114+
}),
115+
],
116+
};
117+
```
118+
119+
```typescript {tabTitle: App Config (Angular <=18)} {filename: app.config.ts} {8, 13-26} {"onboardingOptions": {"performance": "17-26"}}
91120
import {
92121
APP_INITIALIZER,
93122
ApplicationConfig,

platform-includes/getting-started-install/javascript.angular.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ In its current major version, the Sentry Angular SDK only supports Angular 14 an
1616

1717
If you're using an older version of Angular, you also need to use an older version of the SDK. See the table below for compatibility guidance:
1818

19-
| Angular version | Recommended Sentry SDK |
20-
| --------------- | ------------------------------------------------------------------------------------------------------ |
21-
| 14 and newer | `@sentry/angular` |
22-
| 12 or 13 | `@sentry/angular-ivy@^7` (see [Note](#what-is-sentryangular-ivy)) * |
23-
| 10 or 11 | `@sentry/angular@^7` * |
24-
| 9 and below | `@sentry/angular@^6` * |
25-
| AngularJS/1.x | `@sentry/browser@^6` with the [AngularJS integration](/platforms/javascript/guides/angular/angular1) * |
19+
| Angular version | Recommended Sentry SDK |
20+
| --------------- | ------------------------------------------------------------------------------------------------------- |
21+
| 14 and newer | `@sentry/angular` |
22+
| 12 or 13 | `@sentry/angular-ivy@^7` (see [Note](#what-is-sentryangular-ivy)) \* |
23+
| 10 or 11 | `@sentry/angular@^7` \* |
24+
| 9 and below | `@sentry/angular@^6` \* |
25+
| AngularJS/1.x | `@sentry/browser@^6` with the [AngularJS integration](/platforms/javascript/guides/angular/angular1) \* |
2626

2727
\* These versions of the SDK are no longer maintained or tested. Version 7 might still receive bug fixes but we don't guarantee support.
2828

2929
#### What is `@sentry/angular-ivy`?
3030

31-
The `@sentry/angular-ivy` package is an Ivy-compatible version of `@sentry/angular` in version 7 of the SDK. It's recommended to use this package if you're using Angular 12 or 13 to avoid build-time warnings.
31+
The `@sentry/angular-ivy` package was an Ivy-compatible version of `@sentry/angular` in version 7 of the SDK. It's recommended to use this package if you're using Angular 12 or 13 to avoid build-time warnings.
3232
Functionality-wise, it's identical to `@sentry/angular` and you can simply replace all imports of `@sentry/angular` with `@sentry/angular-ivy` in our docs.
33-
Since version 8, the `@sentry/angular-ivy` was [removed and merged](./migration/v7-to-v8/#supported-versions) with `@sentry/angular` which is now Ivy-compatible by default.
33+
Since version 8, `@sentry/angular-ivy` was [removed and merged](./migration/v7-to-v8/#supported-versions) with `@sentry/angular` which is now Ivy-compatible by default.

0 commit comments

Comments
 (0)