-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(react): add comprehensive getting-started guide with StepConnector #14745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will increase total bundle size by 434.23kB (1.9%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-edge-server-array-pushAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
App Routes Affected:
|
<OnboardingOption optionId="session-replay"> | ||
|
||
<PlatformContent includePath="getting-started-tunneling" /> | ||
## Step 5: Customizing Replays |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
c2ab1a5
to
582fb6e
Compare
}); | ||
|
||
// Using template literals for dynamic data | ||
logger.warn(logger.fmt`Rate limit exceeded for user: ${userId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:onCaughtError
/onUncaughtError
Updated Files
src/components/stepConnector/index.tsx
- Fixed quote style consistency to match project Prettier configFeatures
The new guide includes:
Testing
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.