Skip to content

Conversation

codyde
Copy link
Contributor

@codyde codyde commented Sep 22, 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

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

  • All code examples are properly formatted
  • Links and references are valid
  • Clean commit history (single commit)
  • StepConnector component already exists in master

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.

Note: The StepConnector component was already merged in PR #15003, so this PR only adds the new getting-started guide.

- Add step-by-step React getting-started guide with StepConnector
- Include error monitoring, logging, tracing, and replay configuration
- Add React 19+ error handling with onCaughtError/onUncaughtError
- Include optional customizations for replays and traces
- Add verification steps and additional resources
Copy link

vercel bot commented Sep 22, 2025

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

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

@codyde codyde changed the title feat(react): add comprehensive getting-started guide feat(react): add getting-started guide Sep 22, 2025
Copy link

codecov bot commented Sep 22, 2025

Bundle Report

Changes will increase total bundle size by 204 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.13MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.86MB 210 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

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/chunks/8321-*.js -3 bytes 425.87kB -0.0%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
server/middleware-*.js -6.46kB 1.0kB -86.59%
static/10Yj6IUJ2MSMN1JwWqOtR/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/10Yj6IUJ2MSMN1JwWqOtR/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/ulcaXasyctotDTMG-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
static/ulcaXasyctotDTMG-*.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/[[...path]]/page.js.nft.json 73 bytes 824.22kB 0.01%
../app/platform-redirect/page.js.nft.json 73 bytes 824.13kB 0.01%
../app/sitemap.xml/route.js.nft.json 73 bytes 821.37kB 0.01%


<PlatformContent includePath="llm-rules-platform" />

This guide covers the full getting started pocess for the React SDK and assumes you want to utilize Error Monitoring, Logs, Tracing and Spans, and Replays. For the basic quickstart, the [React Quickstart](/platforms/javascript/guides/react/) guide is a better starting point.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename the other "manual" guide to a quickstart guide? Calling it that is a little confusing then going to the page and there being no reference to getting started quickly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the React "quickstart" page, it seems like it would make sense to reference this page, too. Something like "For a comprehensive guide to installing all the things!, use this getting started guide."


<PlatformContent includePath="llm-rules-platform" />

This guide covers the full getting started pocess for the React SDK and assumes you want to utilize Error Monitoring, Logs, Tracing and Spans, and Replays. For the basic quickstart, the [React Quickstart](/platforms/javascript/guides/react/) guide is a better starting point.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This guide covers the full getting started pocess for the React SDK and assumes you want to utilize Error Monitoring, Logs, Tracing and Spans, and Replays. For the basic quickstart, the [React Quickstart](/platforms/javascript/guides/react/) guide is a better starting point.
This guide covers the full getting started process for the React SDK and assumes you want to utilize Error Monitoring, Logs, Tracing and Spans, and Replays. For the basic quickstart, the [React Quickstart](/platforms/javascript/guides/react/) guide is a better starting point.

Comment on lines +19 to +21
```bash {tabTitle:npm}
npm install @sentry/react --save
```
Copy link
Member

Choose a reason for hiding this comment

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

We should also add other package manager options here.

Copy link
Member

Choose a reason for hiding this comment

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

In general: I really like the design with the continuing line on the right 👍
It creates a nice visual hierarchy that's easy to follow.


This guide covers the full getting started pocess for the React SDK and assumes you want to utilize Error Monitoring, Logs, Tracing and Spans, and Replays. For the basic quickstart, the [React Quickstart](/platforms/javascript/guides/react/) guide is a better starting point.

<PlatformContent includePath="getting-started-prerequisites" />
Copy link
Member

Choose a reason for hiding this comment

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

Should the prerequisites maybe be step 1? Because for the wizard, you already need the Sentry Account.


Starting with React 19, use the `onCaughtError` and `onUncaughtError` root options to capture React errors:

```javascript {9-15} {filename:index.jsx}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```javascript {9-15} {filename:index.jsx}
```javascript {8-13} {filename:index.jsx}


</Expandable>

## Sending Logs
Copy link
Member

Choose a reason for hiding this comment

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

Should we add an (optional) here?


## Custom Traces with Attributes (Optional)

[Tracing](/platforms/javascript/guides/react/tracing/) allows you to monitor interactions between multiple services or applications. Create custom spans to measure specific operations and add meaningful attributes. This helps you understand performance bottlenecks and debug issues with detailed context.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you can add a short info here that we already create a bunch of spans. No need to go into detail here, as it's documented on the Tracing page.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants