Skip to content

Commit e9b456e

Browse files
Revert "ref(getting-started-docs): Remove react wizard (#7380)" (#7383)
1 parent cfa935d commit e9b456e

File tree

5 files changed

+306
-0
lines changed

5 files changed

+306
-0
lines changed

src/wizard/javascript/react/index.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: React
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/react/
4+
support_level: production
5+
type: framework
6+
---
7+
8+
In this quick guide you’ll set up `@sentry/react` for [error monitoring](https://docs.sentry.io/platforms/javascript/guides/react/) and [performance monitoring](https://docs.sentry.io/platforms/javascript/guides/react/performance/)
9+
10+
---
11+
12+
## Install
13+
14+
Sentry captures data by using an SDK within your application’s runtime.
15+
16+
```bash
17+
# Using yarn
18+
yarn add @sentry/react
19+
20+
# Using npm
21+
npm install --save @sentry/react
22+
```
23+
24+
## Configure
25+
26+
Initialize Sentry as early as possible in your application's lifecycle.
27+
28+
```javascript
29+
import { createRoot } from "react-dom/client";
30+
import React from "react";
31+
import * as Sentry from "@sentry/react";
32+
import App from "./App";
33+
34+
Sentry.init({
35+
dsn: "___PUBLIC_DSN___",
36+
integrations: [
37+
new Sentry.BrowserTracing({
38+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
39+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
40+
}),
41+
],
42+
tracesSampleRate: 1.0,
43+
});
44+
45+
const container = document.getElementById(“app”);
46+
const root = createRoot(container);
47+
root.render(<App />);
48+
```
49+
50+
> **tracesSampleRate: 1.0**
51+
> The above setting ensures that 100% of transactions will be sent to Sentry, but we recommend lowering this number in production.
52+
53+
## Verify
54+
55+
This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected.
56+
57+
```javascript
58+
return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
59+
```
60+
61+
---
62+
63+
## Next Steps
64+
65+
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
66+
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
67+
- [React Router](https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/): Configure routing, so Sentry can generate parameterized transaction names for a better overview in Performance Monitoring.
68+
- [Session Replay](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/): Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: React
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/react/
4+
support_level: production
5+
type: framework
6+
---
7+
8+
## Install
9+
10+
Sentry captures data by using an SDK within your application’s runtime.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/react
15+
16+
# Using npm
17+
npm install --save @sentry/react
18+
```
19+
20+
## Configure
21+
22+
Initialize Sentry as early as possible in your application's lifecycle.
23+
24+
```javascript
25+
import { createRoot } React from "react-dom/client";
26+
import React from "react";
27+
import * as Sentry from "@sentry/react";
28+
import App from "./App";
29+
30+
Sentry.init({
31+
dsn: "___PUBLIC_DSN___",
32+
integrations: [
33+
new Sentry.BrowserTracing({
34+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
35+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
36+
}),
37+
],
38+
// Performance Monitoring
39+
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
40+
});
41+
42+
const container = document.getElementById(“app”);
43+
const root = createRoot(container);
44+
root.render(<App />)
45+
```
46+
47+
## Verify
48+
49+
This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected.
50+
51+
```javascript
52+
return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
53+
```
54+
55+
---
56+
57+
## Next Steps
58+
59+
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
60+
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
61+
- [React Router](https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/): Configure routing, so Sentry can generate parameterized transaction names for a better overview in Performance Monitoring.
62+
- [Session Replay](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/): Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: React
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/react/
4+
support_level: production
5+
type: framework
6+
---
7+
8+
## Install
9+
10+
Sentry captures data by using an SDK within your application’s runtime.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/react
15+
16+
# Using npm
17+
npm install --save @sentry/react
18+
```
19+
20+
## Configure
21+
22+
Initialize Sentry as early as possible in your application's lifecycle.
23+
24+
```javascript
25+
import { createRoot } React from "react-dom/client";
26+
import React from "react";
27+
import * as Sentry from "@sentry/react";
28+
import App from "./App";
29+
30+
Sentry.init({
31+
dsn: "___PUBLIC_DSN___",
32+
integrations: [new Sentry.Replay()],
33+
// Session Replay
34+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
35+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
36+
});
37+
38+
const container = document.getElementById(“app”);
39+
const root = createRoot(container);
40+
root.render(<App />)
41+
```
42+
43+
## Verify
44+
45+
This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected.
46+
47+
```javascript
48+
return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
49+
```
50+
51+
---
52+
53+
## Next Steps
54+
55+
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
56+
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
57+
- [Performance Monitoring](https://docs.sentry.io/platforms/javascript/guides/react/performance/): Track down transactions to connect the dots between 10-second page loads and poor-performing API calls or slow database queries.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: React
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/react/
4+
support_level: production
5+
type: framework
6+
---
7+
8+
## Install
9+
10+
Sentry captures data by using an SDK within your application’s runtime.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/react
15+
16+
# Using npm
17+
npm install --save @sentry/react
18+
```
19+
20+
## Configure
21+
22+
Initialize Sentry as early as possible in your application's lifecycle.
23+
24+
```javascript
25+
import { createRoot } React from "react-dom/client";
26+
import React from "react";
27+
import * as Sentry from "@sentry/react";
28+
import App from "./App";
29+
30+
Sentry.init({
31+
dsn: "___PUBLIC_DSN___",
32+
integrations: [
33+
new Sentry.BrowserTracing({
34+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
35+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
36+
}),
37+
new Sentry.Replay(),
38+
],
39+
// Performance Monitoring
40+
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
41+
// Session Replay
42+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
43+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
44+
});
45+
46+
const container = document.getElementById(“app”);
47+
const root = createRoot(container);
48+
root.render(<App />)
49+
```
50+
51+
## Verify
52+
53+
This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected.
54+
55+
```javascript
56+
return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
57+
```
58+
59+
---
60+
61+
## Next Steps
62+
63+
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
64+
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
65+
- [React Router](https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/): Configure routing, so Sentry can generate parameterized transaction names for a better overview in Performance Monitoring.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: React
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/react/
4+
support_level: production
5+
type: framework
6+
---
7+
8+
## Install
9+
10+
Sentry captures data by using an SDK within your application’s runtime.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/react
15+
16+
# Using npm
17+
npm install --save @sentry/react
18+
```
19+
20+
## Configure
21+
22+
Initialize Sentry as early as possible in your application's lifecycle.
23+
24+
```javascript
25+
import { createRoot } React from "react-dom/client";
26+
import React from "react";
27+
import * as Sentry from "@sentry/react";
28+
import App from "./App";
29+
30+
Sentry.init({
31+
dsn: "___PUBLIC_DSN___",
32+
});
33+
34+
const container = document.getElementById(“app”);
35+
const root = createRoot(container);
36+
root.render(<App />)
37+
```
38+
39+
## Verify
40+
41+
This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected.
42+
43+
```javascript
44+
return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
45+
```
46+
47+
---
48+
49+
## Next Steps
50+
51+
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
52+
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
53+
- [Performance Monitoring](https://docs.sentry.io/platforms/javascript/guides/react/performance/): Track down transactions to connect the dots between 10-second page loads and poor-performing API calls or slow database queries.
54+
- [Session Replay](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/): Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.

0 commit comments

Comments
 (0)