Skip to content

Commit ad03a25

Browse files
docs(js): Use split layout in Angular & SvelteKit quick start guide (#17227)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This branch updates the following quick start guides to use the new split layout: - Angular wizard - Angular manual setup - SvelteKit wizard - SvelteKit manual setup - SvelteKit on Cloudflare I created temporary include files for tunneling and source maps content (which I will clean up once all guides are updated). I then also updated the Browser JS quick start guide to use these new include files. Closes: #17187 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent aa2f96d commit ad03a25

File tree

11 files changed

+477
-155
lines changed

11 files changed

+477
-155
lines changed

docs/platforms/javascript/guides/angular/index.mdx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,33 @@ at least Angular 17.
2222

2323
</Expandable>
2424

25-
## Step 1: Install
25+
<StepComponent>
26+
## Install
2627

27-
To install Sentry, run the following command within your project:
28+
<SplitLayout>
29+
<SplitSection>
30+
<SplitSectionText>
31+
32+
Run the Sentry wizard to automatically configure Sentry in your Angular application. It will then guide you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
33+
34+
</SplitSectionText>
35+
36+
<SplitSectionCode>
2837

2938
```bash
3039
npx @sentry/wizard@latest -i angular
3140
```
3241

33-
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
42+
</SplitSectionCode>
43+
</SplitSection>
44+
</SplitLayout>
3445

3546
<Include name="quick-start-features-expandable" />
3647

3748
This guide assumes that you enable all features and allow the wizard to add an example component to your application. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later.
3849

50+
Prefer to set things up yourself? Check out the [Manual Setup](/platforms/javascript/guides/angular/manual-setup/) guide.
51+
3952
<Expandable title="What does the installation wizard change inside your application?">
4053

4154
- Adds a `Sentry.init()` call into your `main.ts` file
@@ -46,11 +59,11 @@ This guide assumes that you enable all features and allow the wizard to add an e
4659

4760
</Expandable>
4861

49-
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
62+
## Avoid Ad Blockers With Tunneling (Optional)
5063

51-
<PlatformContent includePath="getting-started-tunneling" />
64+
<PlatformContent includePath="getting-started-tunneling-splitlayout" />
5265

53-
## Step 3: Verify
66+
## Verify
5467

5568
If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that the Sentry SDK is sending data to your Sentry project by using the example component created by the installation wizard:
5669

@@ -89,6 +102,9 @@ Our next recommended steps for you are:
89102
<Expandable permalink={false} title="Are you having problems setting up the SDK?">
90103

91104
- If you encountered issues with our installation wizard, try <PlatformLink to="/manual-setup">setting up Sentry manually</PlatformLink>
105+
- Find various topics in <PlatformLink to="/troubleshooting">Troubleshooting</PlatformLink>
92106
- [Get support](https://sentry.zendesk.com/hc/en-us/)
93107

94108
</Expandable>
109+
110+
</StepComponent>

docs/platforms/javascript/guides/angular/manual-setup.mdx

Lines changed: 96 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@ You need:
1919
- Your application up and running
2020
- Angular version `14.0.0` or above
2121

22-
## Step 1: Install
22+
<StepComponent>
2323

24-
### Install the Sentry SDK
24+
## Install
25+
26+
<SplitLayout>
27+
28+
<SplitSection>
29+
30+
<SplitSectionText>
31+
32+
Run the command for your preferred package manager to add the Sentry SDK to your application.
33+
34+
If you're updating your Sentry SDK to the latest version, check out our [migration guide](https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md) to learn more about breaking changes.
35+
36+
</SplitSectionText>
37+
38+
<SplitSectionCode>
2539

2640
```bash {tabTitle:npm}
2741
npm install @sentry/angular --save
@@ -35,6 +49,10 @@ yarn add @sentry/angular
3549
pnpm add @sentry/angular
3650
```
3751

52+
</SplitSectionCode>
53+
</SplitSection>
54+
</SplitLayout>
55+
3856
<Expandable title="Which SDK version should you use with your Angular version?" permalink="true" level="warning">
3957

4058
In its current major version, the Sentry Angular SDK supports Angular 14 and newer.
@@ -59,9 +77,7 @@ Since version 8, `@sentry/angular-ivy` was <PlatformLink to="/migration/v7-to-v8
5977

6078
</Expandable>
6179

62-
If you're updating your Sentry SDK to the latest version, check out our [migration guide](https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md) to learn more about breaking changes.
63-
64-
## Step 2: Configure
80+
## Configure
6581

6682
Choose the features you want to configure, and this guide will show you how:
6783

@@ -77,10 +93,19 @@ Choose the features you want to configure, and this guide will show you how:
7793

7894
<Include name="quick-start-features-expandable" />
7995

96+
### Initialize the SDK
97+
98+
<SplitLayout>
99+
100+
<SplitSection>
101+
102+
<SplitSectionText>
103+
80104
The main configuration should happen as early as possible in your app's lifecycle. Typically that means in your `main.ts` file.
81-
In addition, you'll need to register some providers to fully instrument your application.
82105

83-
### Initialize the SDK
106+
</SplitSectionText>
107+
108+
<SplitSectionCode>
84109

85110
```typescript {tabTitle: App Config} {filename: main.ts} {5-48}
86111
import { bootstrapApplication } from "@angular/platform-browser";
@@ -213,10 +238,30 @@ platformBrowserDynamic()
213238
.catch((err) => console.error(err));
214239
```
215240

241+
</SplitSectionCode>
242+
</SplitSection>
243+
</SplitLayout>
244+
216245
### Register Sentry Providers
217246

247+
<SplitLayout>
248+
249+
<SplitSection>
250+
251+
<SplitSectionText>
252+
218253
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`:
219254

255+
<Alert level="warning">
256+
257+
If your Angular app is configured for SSR, make sure that the Sentry providers are not accidentally passed to the SSR config (`app.config.server.ts`). The Sentry Angular SDK can only be used in the browser.
258+
259+
</Alert>
260+
261+
</SplitSectionText>
262+
263+
<SplitSectionCode>
264+
220265
```typescript {tabTitle: App Config (Angular 19+)} {filename: app.config.ts} {9, 14-25}
221266
import {
222267
ApplicationConfig,
@@ -312,11 +357,9 @@ import * as Sentry from "@sentry/angular";
312357
export class AppModule {}
313358
```
314359

315-
<Alert>
316-
317-
If your Angular app is configured for SSR, make sure that the Sentry providers are not accidentally passed to the SSR config (`app.config.server.ts`). The Sentry Angular SDK can only be used in the browser.
318-
319-
</Alert>
360+
</SplitSectionCode>
361+
</SplitSection>
362+
</SplitLayout>
320363

321364
<OnboardingOption optionId="performance">
322365

@@ -337,23 +380,35 @@ export class AppModule {
337380

338381
</OnboardingOption>
339382

340-
## Step 3: Add Readable Stack Traces With Source Maps (Optional)
341-
342-
<PlatformContent includePath="getting-started-sourcemaps-short-version" />
383+
### Add Readable Stack Traces With Source Maps (Optional)
343384

344-
Alternatively, take a look at our <PlatformLink to="/sourcemaps">Uploading Source Maps</PlatformLink> docs
385+
<PlatformContent includePath="getting-started-sourcemaps-short-version-splitlayout" />
345386

346-
## Step 4: Avoid Ad Blockers With Tunneling (Optional)
387+
### Avoid Ad Blockers With Tunneling (Optional)
347388

348-
<PlatformContent includePath="getting-started-tunneling" />
389+
<PlatformContent includePath="getting-started-tunneling-splitlayout" />
349390

350-
## Step 5: Verify
391+
## Verify
351392

352393
Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.
353394

354395
### Issues
355396

356-
To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your components (e.g. `app.component.ts`), which will trigger an error that Sentry will capture when you click it:
397+
<SplitLayout>
398+
<SplitSection>
399+
<SplitSectionText>
400+
401+
To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your components (e.g. `app.component.ts`), which will trigger an error that Sentry will capture when you click it.
402+
403+
<OnboardingOption optionId="performance" hideForThisOption>
404+
Open the page in a browser and click the button to trigger a frontend error.
405+
</OnboardingOption>
406+
407+
<PlatformContent includePath="getting-started-browser-sandbox-warning" />
408+
409+
</SplitSectionText>
410+
411+
<SplitSectionCode>
357412

358413
```javascript {filename: app.component.ts} {5, 9-11}
359414
@Component({
@@ -370,16 +425,24 @@ class AppComponent {
370425
}
371426
```
372427

373-
<OnboardingOption optionId="performance" hideForThisOption>
374-
Open the page in a browser and click the button to trigger a frontend error.
375-
</OnboardingOption>
376-
377-
<PlatformContent includePath="getting-started-browser-sandbox-warning" />
428+
</SplitSectionCode>
429+
</SplitSection>
430+
</SplitLayout>
378431

379432
<OnboardingOption optionId="performance">
380433
### Tracing
381434

382-
To test your tracing configuration, update the previous code snippet to start a trace to measure the time it takes to execute your code:
435+
<SplitLayout>
436+
<SplitSection>
437+
<SplitSectionText>
438+
439+
To test your tracing configuration, update the previous code snippet to start a trace to measure the time it takes to execute your code.
440+
441+
Open the page in a browser and click the button to trigger a frontend error and performance trace.
442+
443+
</SplitSectionText>
444+
445+
<SplitSectionCode>
383446

384447
```javascript {filename: app.component.ts} {10-11, 13-14}
385448
@Component({
@@ -400,13 +463,15 @@ class AppComponent {
400463
}
401464
```
402465

403-
Open the page in a browser and click the button to trigger a frontend error and performance trace.
466+
</SplitSectionCode>
467+
</SplitSection>
468+
</SplitLayout>
404469

405470
</OnboardingOption>
406471

407472
<OnboardingOption optionId="logs">
408473

409-
<Include name="logs/javascript-quick-start-verify-logs" />
474+
<Include name="logs/javascript-quick-start-verify-logs-splitlayout" />
410475

411476
</OnboardingOption>
412477

@@ -422,6 +487,7 @@ At this point, you should have integrated Sentry into your Angular application a
422487

423488
Now's a good time to customize your setup and look into more advanced topics. Our next recommended steps for you are:
424489

490+
- Explore [practical guides](/guides/) on what to monitor, log, track, and investigate after setup
425491
- Extend Sentry to your backend using one of our [SDKs](/)
426492
- Continue to <PlatformLink to="/configuration">customize your configuration</PlatformLink>
427493
- Make use of <PlatformLink to="/features">Angular-specific features</PlatformLink>
@@ -434,3 +500,5 @@ Now's a good time to customize your setup and look into more advanced topics. Ou
434500
- [Get support](https://sentry.zendesk.com/hc/en-us/)
435501

436502
</Expandable>
503+
504+
</StepComponent>

docs/platforms/javascript/guides/sveltekit/index.mdx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,26 @@ categories:
1313

1414
<PlatformContent includePath="getting-started-prerequisites" />
1515

16-
## Step 1: Install
16+
<StepComponent>
17+
## Install
1718

18-
To install Sentry using the installation wizard, run the following command within your project:
19+
<SplitLayout>
20+
<SplitSection>
21+
<SplitSectionText>
22+
23+
Run the Sentry wizard to automatically configure Sentry in your Angular application. It will then guide you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
24+
25+
</SplitSectionText>
26+
27+
<SplitSectionCode>
1928

2029
```bash
2130
npx @sentry/wizard@latest -i sveltekit
2231
```
2332

24-
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
33+
</SplitSectionCode>
34+
</SplitSection>
35+
</SplitLayout>
2536

2637
<Include name="quick-start-features-expandable" />
2738

@@ -39,11 +50,11 @@ This guide assumes that you enable all features and allow the wizard to create a
3950

4051
</Expandable>
4152

42-
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
53+
## Avoid Ad Blockers With Tunneling (Optional)
4354

4455
<PlatformContent includePath="getting-started-tunneling" />
4556

46-
## Step 3: Verify Your Setup
57+
## Verify Your Setup
4758

4859
If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page and route created by the installation wizard:
4960

@@ -89,3 +100,5 @@ Our next recommended steps for you are:
89100
- [Get support](https://sentry.zendesk.com/hc/en-us/)
90101

91102
</Expandable>
103+
104+
</StepComponent>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Logs <FeatureBadge type="new" size="small" />
2+
3+
<SplitLayout>
4+
<SplitSection>
5+
<SplitSectionText>
6+
To verify that Sentry catches your logs, add some log statements to your application:
7+
8+
</SplitSectionText>
9+
10+
<SplitSectionCode>
11+
12+
```javascript
13+
Sentry.logger.info("User example action completed");
14+
15+
Sentry.logger.warn("Slow operation detected", {
16+
operation: "data_fetch",
17+
duration: 3500,
18+
});
19+
20+
Sentry.logger.error("Validation failed", {
21+
field: "email",
22+
reason: "Invalid email",
23+
});
24+
```
25+
26+
</SplitSectionCode>
27+
</SplitSection>
28+
</SplitLayout>

0 commit comments

Comments
 (0)