Skip to content

Conversation

codyde
Copy link
Contributor

@codyde codyde commented Aug 27, 2025

Overview

This PR adds a comprehensive React getting-started guide that provides step-by-step instructions for setting up the full Sentry React SDK with all features enabled.

Changes

New Files

  • docs/platforms/javascript/guides/react/getting-started.mdx - Complete getting-started guide with:
    • Step-by-step installation and configuration
    • React 19+ error handling with onCaughtError/onUncaughtError
    • React 16-18 error boundary setup
    • Structured logging examples
    • Session replay customization
    • Custom tracing with attributes
    • Tunneling configuration
    • Verification steps

Updated Files

  • src/components/stepConnector/index.tsx - Fixed quote style consistency to match project Prettier config

Features

The new guide includes:

  • StepConnector integration for guided workflow
  • Error monitoring setup for all React versions
  • Performance monitoring with custom spans
  • Session replay with privacy controls
  • Structured logging with meaningful attributes
  • Tunneling to avoid ad blockers
  • Verification steps to confirm setup

Testing

  • StepConnector component works correctly
  • All code examples are properly formatted
  • Links and references are valid
  • Quote style matches project standards
  • Clean commit history (no duplicate commits)

Related

This complements the existing React quickstart guide by providing a more comprehensive setup flow for users who want all Sentry features enabled from the start.

Copy link

vercel bot commented Aug 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Sep 22, 2025 6:15pm
sentry-docs Ready Ready Preview Comment Sep 22, 2025 6:15pm

Copy link

codecov bot commented Aug 27, 2025

Bundle Report

Changes will increase total bundle size by 434.23kB (1.9%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-edge-server-array-push 352.16kB -150 bytes (-0.04%) ⬇️
sentry-docs-client-array-push 10.13MB 230.12kB (2.32%) ⬆️
sentry-docs-server-cjs 12.75MB 204.26kB (1.63%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-edge-server-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
src/middleware.js -150 bytes 207.44kB -0.07%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/css/*.css 8.49kB 21.39kB 65.81% ⚠️
static/css/*.css 3.07kB 15.78kB 24.13% ⚠️
static/css/*.css 1.02kB 12.71kB 8.74% ⚠️
static/css/*.css 1 bytes 1.89kB 0.05%
static/css/*.css 441 bytes 746.36kB 0.06%
static/css/*.css 1.32kB 6.16kB 27.17% ⚠️
static/css/*.css 928 bytes 1.89kB 96.57% ⚠️
static/css/*.css (Deleted) -11.55kB 0 bytes -100.0% 🗑️
static/chunks/3641.*.js 267.62kB 548.32kB 95.34% ⚠️
static/chunks/49699944.*.js (New) 443.01kB 443.01kB 100.0% 🚀
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/chunks/3d9768ee.*.js (New) 359.71kB 359.71kB 100.0% 🚀
static/chunks/756b3e49.*.js (New) 275.44kB 275.44kB 100.0% 🚀
server/app/api/ip-*.js 1.7kB 265.08kB 0.64%
server/app/_not-*.js 1.7kB 265.07kB 0.64%
server/app/[[...path]]/page_client-*.js 1.7kB 265.03kB 0.64%
server/app/platform-*.js 1.54kB 249.71kB 0.62%
static/chunks/586.*.js (New) 157.04kB 157.04kB 100.0% 🚀
static/chunks/124-*.js (New) 145.04kB 145.04kB 100.0% 🚀
static/chunks/9828.*.js (New) 99.74kB 99.74kB 100.0% 🚀
static/chunks/app/[[...path]]/page-*.js 4.95kB 92.96kB 5.62% ⚠️
static/chunks/4985.*.js (New) 84.13kB 84.13kB 100.0% 🚀
static/chunks/868.*.js (New) 77.78kB 77.78kB 100.0% 🚀
static/chunks/7753.*.js (New) 71.95kB 71.95kB 100.0% 🚀
static/chunks/120.*.js (New) 61.1kB 61.1kB 100.0% 🚀
static/chunks/4145-*.js 471 bytes 50.44kB 0.94%
static/chunks/1289.*.js (New) 46.56kB 46.56kB 100.0% 🚀
static/chunks/2050.*.js (New) 43.69kB 43.69kB 100.0% 🚀
static/chunks/3123.*.js (New) 39.35kB 39.35kB 100.0% 🚀
static/chunks/9710.*.js (New) 36.95kB 36.95kB 100.0% 🚀
static/chunks/8110.*.js (New) 34.29kB 34.29kB 100.0% 🚀
static/media/7c239973d8aef789-*.woff2 (New) 32.56kB 32.56kB 100.0% 🚀
static/media/32c80fb7588b7a2e-*.woff2 (New) 32.48kB 32.48kB 100.0% 🚀
static/chunks/8063.*.js (New) 32.13kB 32.13kB 100.0% 🚀
static/chunks/1704.*.js (New) 31.36kB 31.36kB 100.0% 🚀
static/chunks/4919.*.js (New) 29.59kB 29.59kB 100.0% 🚀
static/chunks/2459.*.js (New) 26.19kB 26.19kB 100.0% 🚀
static/chunks/9900.*.js (New) 26.03kB 26.03kB 100.0% 🚀
static/chunks/6664.*.js (New) 24.19kB 24.19kB 100.0% 🚀
static/chunks/4179.*.js (New) 23.97kB 23.97kB 100.0% 🚀
static/chunks/1992.*.js (New) 22.14kB 22.14kB 100.0% 🚀
static/media/a5d9f2ead0568494-*.woff2 (New) 21.08kB 21.08kB 100.0% 🚀
static/chunks/2208.*.js (New) 20.91kB 20.91kB 100.0% 🚀
static/media/5b25d60b4670300e-*.woff2 (New) 19.29kB 19.29kB 100.0% 🚀
static/chunks/2091.*.js (New) 19.27kB 19.27kB 100.0% 🚀
static/chunks/25.*.js (New) 13.9kB 13.9kB 100.0% 🚀
static/chunks/app/platform-*.js 74 bytes 13.3kB 0.56%
static/chunks/4152.*.js (New) 12.25kB 12.25kB 100.0% 🚀
static/chunks/5997.*.js (New) 11.94kB 11.94kB 100.0% 🚀
static/chunks/2027.*.js (New) 11.87kB 11.87kB 100.0% 🚀
static/chunks/4418.*.js (New) 11.53kB 11.53kB 100.0% 🚀
static/media/fc5b975a09123a00-*.woff2 (New) 9.75kB 9.75kB 100.0% 🚀
static/media/99e31c27a1524300-*.woff2 (New) 9.35kB 9.35kB 100.0% 🚀
react-*.json 1.08kB 8.78kB 14.04% ⚠️
static/chunks/7655.*.js (New) 8.49kB 8.49kB 100.0% 🚀
server/middleware-*.js 902 bytes 7.46kB 13.76% ⚠️
static/chunks/webpack-*.js 94 bytes 5.43kB 1.76%
app-*.json -84 bytes 4.59kB -1.8%
static/chunks/6113.*.js (New) 1.17kB 1.17kB 100.0% 🚀
static/chunks/8797.*.js (New) 1.17kB 1.17kB 100.0% 🚀
static/chunks/5634.*.js (New) 1.16kB 1.16kB 100.0% 🚀
/static/media/tracing.*.svg (New) 1.15kB 1.15kB 100.0% 🚀
/static/media/tracing.*.svg (New) 1.16kB 1.16kB 100.0% 🚀
static/chunks/2665.*.js (New) 925 bytes 925 bytes 100.0% 🚀
static/chunks/8884.*.js (New) 920 bytes 920 bytes 100.0% 🚀
static/chunks/5879.*.js (New) 919 bytes 919 bytes 100.0% 🚀
static/chunks/7752.*.js (New) 919 bytes 919 bytes 100.0% 🚀
static/chunks/4574.*.js (New) 918 bytes 918 bytes 100.0% 🚀
static/chunks/5697.*.js (New) 917 bytes 917 bytes 100.0% 🚀
static/chunks/6504.*.js (New) 916 bytes 916 bytes 100.0% 🚀
static/moLJ2QnOL_1lGUnWYKPrK/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/moLJ2QnOL_1lGUnWYKPrK/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/chunks/952c863e.*.js (Deleted) -399.92kB 0 bytes -100.0% 🗑️
static/chunks/21f17e4c.*.js (Deleted) -324.08kB 0 bytes -100.0% 🗑️
static/chunks/1835b391.*.js (Deleted) -274.13kB 0 bytes -100.0% 🗑️
static/chunks/f3e15c50.*.js (Deleted) -240.37kB 0 bytes -100.0% 🗑️
static/chunks/910.*.js (Deleted) -153.64kB 0 bytes -100.0% 🗑️
static/chunks/7909-*.js (Deleted) -144.72kB 0 bytes -100.0% 🗑️
static/chunks/5279.*.js (Deleted) -103.17kB 0 bytes -100.0% 🗑️
static/chunks/4820.*.js (Deleted) -90.25kB 0 bytes -100.0% 🗑️
static/chunks/27.*.js (Deleted) -77.17kB 0 bytes -100.0% 🗑️
static/chunks/4335.*.js (Deleted) -71.94kB 0 bytes -100.0% 🗑️
static/chunks/3863.*.js (Deleted) -57.63kB 0 bytes -100.0% 🗑️
static/chunks/6127.*.js (Deleted) -44.68kB 0 bytes -100.0% 🗑️
static/chunks/7755.*.js (Deleted) -43.45kB 0 bytes -100.0% 🗑️
static/chunks/4033.*.js (Deleted) -37.92kB 0 bytes -100.0% 🗑️
static/chunks/2288.*.js (Deleted) -34.42kB 0 bytes -100.0% 🗑️
static/chunks/4716.*.js (Deleted) -34.28kB 0 bytes -100.0% 🗑️
static/media/4fca85807f6c09f6-*.woff2 (Deleted) -32.6kB 0 bytes -100.0% 🗑️
static/media/d695df15e3ff125c-*.woff2 (Deleted) -32.58kB 0 bytes -100.0% 🗑️
static/chunks/7599.*.js (Deleted) -32.19kB 0 bytes -100.0% 🗑️
static/chunks/6691.*.js (Deleted) -29.46kB 0 bytes -100.0% 🗑️
static/chunks/828.*.js (Deleted) -26.22kB 0 bytes -100.0% 🗑️
static/chunks/8834.*.js (Deleted) -24.98kB 0 bytes -100.0% 🗑️
static/chunks/2227.*.js (Deleted) -24.12kB 0 bytes -100.0% 🗑️
static/chunks/3628.*.js (Deleted) -23.88kB 0 bytes -100.0% 🗑️
static/media/acdf4f392b58827a-*.woff2 (Deleted) -21.13kB 0 bytes -100.0% 🗑️
static/chunks/3175.*.js (Deleted) -20.48kB 0 bytes -100.0% 🗑️
static/media/501d9eeee6e2b0cc-*.woff2 (Deleted) -19.41kB 0 bytes -100.0% 🗑️
static/chunks/407.*.js (Deleted) -11.88kB 0 bytes -100.0% 🗑️
static/chunks/2934.*.js (Deleted) -11.82kB 0 bytes -100.0% 🗑️
static/media/a72efd2c2476ebb2-*.woff2 (Deleted) -9.7kB 0 bytes -100.0% 🗑️
static/media/9d7436bc73437f75-*.woff2 (Deleted) -9.36kB 0 bytes -100.0% 🗑️
static/chunks/7740.*.js (Deleted) -9.11kB 0 bytes -100.0% 🗑️
static/chunks/4646.*.js (Deleted) -8.99kB 0 bytes -100.0% 🗑️
static/chunks/1182.*.js (Deleted) -5.88kB 0 bytes -100.0% 🗑️
static/chunks/3140.*.js (Deleted) -1.14kB 0 bytes -100.0% 🗑️
static/chunks/7926.*.js (Deleted) -1.14kB 0 bytes -100.0% 🗑️
static/chunks/9045.*.js (Deleted) -1.14kB 0 bytes -100.0% 🗑️
static/chunks/3072.*.js (Deleted) -925 bytes 0 bytes -100.0% 🗑️
static/chunks/6272.*.js (Deleted) -921 bytes 0 bytes -100.0% 🗑️
static/chunks/2534.*.js (Deleted) -919 bytes 0 bytes -100.0% 🗑️
static/chunks/9241.*.js (Deleted) -917 bytes 0 bytes -100.0% 🗑️
static/chunks/7993.*.js (Deleted) -916 bytes 0 bytes -100.0% 🗑️
static/xi5cBN81bbk7zOonsazxP/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/xi5cBN81bbk7zOonsazxP/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js 22 bytes 1.78MB 0.0%
../instrumentation.js 22 bytes 1.1MB 0.0%
9523.js 22 bytes 1.08MB 0.0%
../app/[[...path]]/page.js.nft.json 3.5kB 787.42kB 0.45%
../app/platform-redirect/page.js.nft.json 3.5kB 787.33kB 0.45%
../app/sitemap.xml/route.js.nft.json 3.26kB 784.56kB 0.42%
../app/[[...path]]/page.js 4.24kB 613.04kB 0.7%
8049.js 28.05kB 548.34kB 5.39% ⚠️
1561.js (New) 443.03kB 443.03kB 100.0% 🚀
9269.js (New) 366.77kB 366.77kB 100.0% 🚀
5017.js (New) 275.46kB 275.46kB 100.0% 🚀
9883.js (New) 218.27kB 218.27kB 100.0% 🚀
8454.js (New) 150.03kB 150.03kB 100.0% 🚀
6548.js (New) 99.76kB 99.76kB 100.0% 🚀
4873.js 219 bytes 91.14kB 0.24%
5947.js (New) 84.15kB 84.15kB 100.0% 🚀
8478.js (New) 77.8kB 77.8kB 100.0% 🚀
5905.js (New) 71.97kB 71.97kB 100.0% 🚀
6795.js (New) 61.11kB 61.11kB 100.0% 🚀
257.js (New) 46.58kB 46.58kB 100.0% 🚀
2300.js (New) 43.71kB 43.71kB 100.0% 🚀
5629.js (New) 39.37kB 39.37kB 100.0% 🚀
7238.js (New) 36.97kB 36.97kB 100.0% 🚀
7390.js (New) 34.31kB 34.31kB 100.0% 🚀
../app/platform-redirect/page.js 160 bytes 32.06kB 0.5%
8790.js (New) 31.38kB 31.38kB 100.0% 🚀
713.js (New) 29.56kB 29.56kB 100.0% 🚀
7484.js (New) 26.21kB 26.21kB 100.0% 🚀
1058.js (New) 26.05kB 26.05kB 100.0% 🚀
2351.js (New) 25.12kB 25.12kB 100.0% 🚀
6768.js (New) 24.2kB 24.2kB 100.0% 🚀
291.js (New) 23.99kB 23.99kB 100.0% 🚀
8938.js (New) 22.16kB 22.16kB 100.0% 🚀
7244.js (New) 20.92kB 20.92kB 100.0% 🚀
4819.js (New) 12.26kB 12.26kB 100.0% 🚀
4781.js (New) 11.95kB 11.95kB 100.0% 🚀
776.js (New) 11.55kB 11.55kB 100.0% 🚀
8065.js (New) 6.89kB 6.89kB 100.0% 🚀
7000.js (New) 5.23kB 5.23kB 100.0% 🚀
9153.js (New) 4.85kB 4.85kB 100.0% 🚀
7067.js (New) 1.47kB 1.47kB 100.0% 🚀
4749.js (New) 1.19kB 1.19kB 100.0% 🚀
523.js (New) 1.18kB 1.18kB 100.0% 🚀
6998.js (New) 1.18kB 1.18kB 100.0% 🚀
../../static/media/tracing.*.svg (New) 1.16kB 1.16kB 100.0% 🚀
../../static/media/tracing.*.svg (New) 1.15kB 1.15kB 100.0% 🚀
4865.js (New) 911 bytes 911 bytes 100.0% 🚀
3331.js (New) 905 bytes 905 bytes 100.0% 🚀
7502.js (New) 905 bytes 905 bytes 100.0% 🚀
7560.js (New) 904 bytes 904 bytes 100.0% 🚀
5225.js -253 bytes 903 bytes -21.89%
1938.js (New) 902 bytes 902 bytes 100.0% 🚀
388.js (New) 902 bytes 902 bytes 100.0% 🚀
6173.js (Deleted) -399.94kB 0 bytes -100.0% 🗑️
7106.js (Deleted) -328.57kB 0 bytes -100.0% 🗑️
434.js (Deleted) -274.15kB 0 bytes -100.0% 🗑️
5109.js (Deleted) -217.64kB 0 bytes -100.0% 🗑️
8122.js (Deleted) -149.2kB 0 bytes -100.0% 🗑️
5141.js (Deleted) -103.19kB 0 bytes -100.0% 🗑️
3776.js (Deleted) -90.27kB 0 bytes -100.0% 🗑️
2530.js (Deleted) -77.19kB 0 bytes -100.0% 🗑️
875.js (Deleted) -71.96kB 0 bytes -100.0% 🗑️
1419.js (Deleted) -57.65kB 0 bytes -100.0% 🗑️
4167.js (Deleted) -44.7kB 0 bytes -100.0% 🗑️
2657.js (Deleted) -43.47kB 0 bytes -100.0% 🗑️
167.js (Deleted) -37.94kB 0 bytes -100.0% 🗑️
9952.js (Deleted) -34.44kB 0 bytes -100.0% 🗑️
4412.js (Deleted) -34.3kB 0 bytes -100.0% 🗑️
5207.js (Deleted) -32.21kB 0 bytes -100.0% 🗑️
2638.js (Deleted) -26.24kB 0 bytes -100.0% 🗑️
1031.js (Deleted) -25.02kB 0 bytes -100.0% 🗑️
6240.js (Deleted) -25.0kB 0 bytes -100.0% 🗑️
7019.js (Deleted) -24.14kB 0 bytes -100.0% 🗑️
6060.js (Deleted) -23.9kB 0 bytes -100.0% 🗑️
7275.js (Deleted) -20.5kB 0 bytes -100.0% 🗑️
8327.js (Deleted) -11.9kB 0 bytes -100.0% 🗑️
8440.js (Deleted) -11.84kB 0 bytes -100.0% 🗑️
9136.js (Deleted) -4.67kB 0 bytes -100.0% 🗑️
6184.js (Deleted) -4.55kB 0 bytes -100.0% 🗑️
6390.js (Deleted) -1.44kB 0 bytes -100.0% 🗑️
4846.js (Deleted) -1.16kB 0 bytes -100.0% 🗑️
678.js (Deleted) -1.15kB 0 bytes -100.0% 🗑️
7692.js (Deleted) -911 bytes 0 bytes -100.0% 🗑️
7452.js (Deleted) -907 bytes 0 bytes -100.0% 🗑️
5690.js (Deleted) -905 bytes 0 bytes -100.0% 🗑️
4937.js (Deleted) -903 bytes 0 bytes -100.0% 🗑️
1899.js (Deleted) -902 bytes 0 bytes -100.0% 🗑️

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 190.61kB 3.36MB 6.01% ⚠️
/platform-redirect 186.53kB 2.78MB 7.2% ⚠️
/ 186.37kB 2.81MB 7.1% ⚠️

@codyde codyde changed the title React: Restructure documentation with step-based flow React: Expand getting started flow to include next product configs Aug 27, 2025
@codyde codyde changed the title React: Expand getting started flow to include next product configs (DRAFT - In Progress) React: Expand getting started flow to include next product configs Aug 27, 2025
<OnboardingOption optionId="session-replay">

<PlatformContent includePath="getting-started-tunneling" />
## Step 5: Customizing Replays
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step numbering might be confusing when not all features are selected.

Maybe we should even skip the numbering for optional features. When first looking at the page it might look overwhelming when seeing 7 steps. The header for the optional features could just be something like this:
## Session Replay: Customize

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that suggestion - going to use it. Thank you! I'm also going to investigate some ways to create a separator between the "core" steps, and extended config - but i love the idea of making the mandatory steps numbered.


Add the following to your application's entry point (typically `index.js`, `main.js`, or `App.js`) or to the file before you use any other Sentry method:

```javascript {filename:instrument.js}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could update the filename here to match the above mentioned filenames.

Also make sure that this step matches with the step below. In a step below you mention, that people should import the instrument.js file, but we don't mention creating that anymore: https://github.com/getsentry/sentry-docs/pull/14745/files#diff-93dbd46244eede6a25dba5637466575690eb8b83691c8ba891f9ebf171198e3aR107

// Sentry initialization should be imported first!
import "./instrument";
import App from "./App";
Import the `instrument.js` file in your application's entry point _before all other imports_ to initialize the SDK:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already mentioned above, the instrument.js file does not exist when following the steps.

- Add comprehensive React getting-started guide with step-by-step flow
- Fix StepConnector component quote style consistency (single -> double quotes)
- Include error monitoring, logging, tracing, and replay configuration
- Add React 19+ error handling with onCaughtError/onUncaughtError
- Include optional customizations for replays and traces
- Revert to single quotes to match project's singleQuote: true setting
- Ensures consistency with automated formatting
@codyde codyde force-pushed the feat/react-docs-restructure-clean branch from c2ab1a5 to 582fb6e Compare September 22, 2025 17:35
@codyde codyde marked this pull request as ready for review September 22, 2025 17:38
@codyde codyde changed the title (DRAFT - In Progress) React: Expand getting started flow to include next product configs feat(react): add comprehensive getting-started guide with StepConnector Sep 22, 2025
});

// Using template literals for dynamic data
logger.warn(logger.fmt`Rate limit exceeded for user: ${userId}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Undefined Variable in Template Literal

The logger.warn example references userId within a template literal, but userId isn't defined in that scope. This causes a ReferenceError when the code executes.

Fix in Cursor Fix in Web

@codyde
Copy link
Contributor Author

codyde commented Sep 22, 2025

Closing this PR in favor of #15011 which has a clean commit history with only the getting-started guide changes. The StepConnector component was already merged in PR #15003.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants