Skip to content

Commit 3db6bb9

Browse files
docs(js): Add tunneling to existing quick start guides (#13803)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Added a step on tunneling to our existing (relevant) quick start guides: - Angular (manual, wizard) - React (manual) - Nuxt (manual, wizard) - Svelte (manual) - Sveltekit (manual, wizard) - Remix (wizard) Closes: #13713 ## 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 49be37c commit 3db6bb9

File tree

12 files changed

+90
-29
lines changed

12 files changed

+90
-29
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Angular
3-
description: 'Learn how to set up Sentry in your Angular application and capture your first errors.'
3+
description: "Learn how to set up Sentry in your Angular application and capture your first errors."
44
sdk: sentry.javascript.angular
55
categories:
66
- javascript
@@ -46,7 +46,11 @@ This guide assumes that you enable all features and allow the wizard to add an e
4646

4747
</Expandable>
4848

49-
## Step 2: Verify
49+
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
50+
51+
<PlatformContent includePath="getting-started-tunneling" />
52+
53+
## Step 3: Verify
5054

5155
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:
5256

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: "Learn how to set up the Sentry Angular SDK manually."
99
installer](/platforms/javascript/guides/angular).
1010
</Alert>
1111

12-
1312
If you can't (or prefer not to) use the installation wizard, follow the instructions below to configure the Sentry Angular SDK in your application. This guide is also useful to adjust the pre-set configuration if you used the installation wizard for automatic setup.
1413

1514
## Prerequisites
@@ -24,7 +23,9 @@ You need:
2423

2524
Choose the features you want to configure, and this guide will show you how:
2625

27-
<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay"]} />
26+
<OnboardingOptionButtons
27+
options={["error-monitoring", "performance", "session-replay"]}
28+
/>
2829

2930
<PlatformContent includePath="getting-started-features-expandable" />
3031

@@ -44,7 +45,6 @@ pnpm add @sentry/angular
4445

4546
<Expandable title="Which SDK version should you use with your Angular version?" permalink="true" level="warning">
4647

47-
4848
In its current major version, the Sentry Angular SDK supports Angular 14 and newer.
4949

5050
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:
@@ -187,7 +187,6 @@ platformBrowserDynamic()
187187

188188
### Register Sentry Providers
189189

190-
191190
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`:
192191

193192
```typescript {tabTitle: App Config (Angular 19+)} {filename: app.config.ts} {9, 14-25}
@@ -284,6 +283,7 @@ import * as Sentry from "@sentry/angular";
284283
})
285284
export class AppModule {}
286285
```
286+
287287
<Alert>
288288

289289
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.
@@ -315,15 +315,18 @@ export class AppModule {
315315

316316
Alternatively, take a look at our <PlatformLink to="/sourcemaps">Uploading Source Maps</PlatformLink> docs
317317

318-
## Step 4: Verify
318+
## Step 4: Avoid Ad Blockers With Tunneling (Optional)
319+
320+
<PlatformContent includePath="getting-started-tunneling" />
321+
322+
## Step 5: Verify
319323

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

322326
### Issues
323327

324328
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:
325329

326-
327330
```javascript {filename: app.component.ts} {5, 9-11}
328331
@Component({
329332
selector: "app-root",

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ This guide assumes that you enable all features and allow the wizard to create a
4040

4141
</Expandable>
4242

43-
## Step 2: Verify Your Setup
43+
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
44+
45+
<PlatformContent includePath="getting-started-tunneling" />
46+
47+
## Step 3: Verify Your Setup
4448

4549
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 created by the installation wizard.
4650

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Sentry.init({
9696
// dsn: useRuntimeConfig().public.sentry.dsn
9797
// modify depending on your custom runtime config
9898
dsn: "___PUBLIC_DSN___",
99-
99+
100100
// Adds request headers and IP for users, for more info visit:
101101
// https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii
102102
sendDefaultPii: true,
@@ -225,7 +225,11 @@ export default defineNuxtConfig({
225225

226226
The `hidden` option enables source map generation while preventing source map reference comments that would normally appear at the end of each generated file in the build output.
227227

228-
## Step 4: Verify Your Setup
228+
## Step 4: Avoid Ad Blockers With Tunneling (Optional)
229+
230+
<PlatformContent includePath="getting-started-tunneling" />
231+
232+
## Step 5: Verify Your Setup
229233

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

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,19 @@ To capture Redux state data, use `Sentry.createReduxEnhancer` when initializing
180180
<PlatformContent includePath="getting-started-sourcemaps-short-version" />
181181

182182
<OnboardingOption optionId="performance">
183-
## Step 7: Verify Your Setup
183+
## Step 7: Avoid Ad Blockers With Tunneling (Optional)
184+
</OnboardingOption>
185+
<OnboardingOption optionId="performance" hideForThisOption>
186+
## Step 6: Avoid Ad Blockers With Tunneling (Optional)
187+
</OnboardingOption>
188+
189+
<PlatformContent includePath="getting-started-tunneling" />
190+
191+
<OnboardingOption optionId="performance">
192+
## Step 8: Verify Your Setup
184193
</OnboardingOption>
185194
<OnboardingOption optionId="performance" hideForThisOption>
186-
## Step 6: Verify Your Setup
195+
## Step 7: Verify Your Setup
187196
</OnboardingOption>
188197

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

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ This guide assumes that you enable all features and allow the wizard to create a
3636

3737
</Expandable>
3838

39-
## Step 2: Verify Your Setup
39+
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
40+
41+
<PlatformContent includePath="getting-started-tunneling" />
42+
43+
## Step 3: Verify Your Setup
4044

4145
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 created by the installation wizard:
4246

43-
1. Open the example page `/sentry-example-page` in your browser. For most Remix applications, this will be at localhost.
47+
1. Open the example page `/sentry-example-page` in your browser. For most Remix applications, this will be at localhost.
4448
2. Click the "Throw Sample Error" button to trigger a frontend error and trace.
4549

4650
<Alert level="success" title="Tip">

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ export default app;
143143

144144
<PlatformContent includePath="getting-started-sourcemaps-short-version" />
145145

146-
## Step 4: Verify Your Setup
146+
## Step 4: Avoid Ad Blockers With Tunneling (Optional)
147+
148+
<PlatformContent includePath="getting-started-tunneling" />
149+
150+
## Step 5: Verify Your Setup
147151

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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ This guide assumes that you enable all features and allow the wizard to create a
3434

3535
</Expandable>
3636

37-
## Step 2: Verify Your Setup
37+
## Step 2: Avoid Ad Blockers With Tunneling (Optional)
38+
39+
<PlatformContent includePath="getting-started-tunneling" />
40+
41+
## Step 3: Verify Your Setup
3842

3943
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:
4044

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,7 @@ Follow this guide to [configure Sentry for Cloudflare](/platforms/javascript/gui
403403

404404
## Step 5: Avoid Ad Blockers With Tunneling (Optional)
405405

406-
You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option to add an API endpoint in your application that forwards Sentry events to Sentry servers.
407-
408-
Update `Sentry.init` in your `hooks.client.(js|ts)` file with the following option:
409-
410-
```javascript {filename:hooks.client.(js|ts)}
411-
Sentry.init({
412-
dsn: "___PUBLIC_DSN___",,
413-
tunnel: "/tunnel",
414-
});
415-
```
416-
417-
This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you need to do additional configuration on the server. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option).
406+
<PlatformContent includePath="getting-started-tunneling" />
418407

419408
## Step 6: Verify Your Setup
420409

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option to add an API endpoint in your application that forwards Sentry events to Sentry servers.
2+
3+
To enable tunneling, update `Sentry.init` with the following option:
4+
5+
```javascript {3}
6+
Sentry.init({
7+
dsn: "___PUBLIC_DSN___",,
8+
tunnel: "/tunnel",
9+
});
10+
```
11+
12+
This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. You can find a detailed explanation on how to do this on our <PlatformLink to="/troubleshooting/#using-the-tunnel-option"> Troubleshooting page</PlatformLink>.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option to add an API endpoint in your application that forwards Sentry events to Sentry servers.
2+
3+
To enable tunneling, update `Sentry.init` in your `entry.client.tsx` file with the following option:
4+
5+
```javascript {filename:entry.client.tsx}{3}
6+
Sentry.init({
7+
dsn: "___PUBLIC_DSN___",,
8+
tunnel: "/tunnel",
9+
});
10+
```
11+
12+
This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. You can find a detailed explanation on how to do this on our <PlatformLink to="/troubleshooting/#using-the-tunnel-option"> Troubleshooting page</PlatformLink>.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option to add an API endpoint in your application that forwards Sentry events to Sentry servers.
2+
3+
To enable tunneling, update `Sentry.init` in your `hooks.client.(js|ts)` file with the following option:
4+
5+
```javascript {filename:hooks.client.(js|ts)}
6+
Sentry.init({
7+
dsn: "___PUBLIC_DSN___",,
8+
tunnel: "/tunnel",
9+
});
10+
```
11+
12+
This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option).

0 commit comments

Comments
 (0)