Skip to content

Commit faf5812

Browse files
authored
feat(gatsby): standardize gatsby docs (#6294)
1 parent 6094533 commit faf5812

File tree

4 files changed

+28
-30
lines changed

4 files changed

+28
-30
lines changed

src/platform-includes/getting-started-config/javascript.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ Sentry.init({
1616
// of transactions for performance monitoring.
1717
// We recommend adjusting this value in production
1818
tracesSampleRate: 1.0,
19-
2019
});
2120
```

src/platforms/javascript/guides/gatsby/index.mdx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yarn add @sentry/gatsby
2222

2323
</Note>
2424

25-
First add `@sentry/gatsby` as a plugin to your `gatsby-config.js`.
25+
Register the `@sentry/gatsby` plugin in your Gatsby configuration file (typically `gatsby-config.js`).
2626

2727
```javascript {filename:gatsby-config.js}
2828
module.exports = {
@@ -41,16 +41,11 @@ import * as Sentry from "@sentry/gatsby";
4141

4242
Sentry.init({
4343
dsn: "___PUBLIC_DSN___",
44-
tracesSampleRate: 1.0, // Adjust this value in production
45-
beforeSend(event) {
46-
// Modify the event here
47-
if (event.user) {
48-
// Don't send user's email address
49-
delete event.user.email;
50-
}
51-
return event;
52-
},
53-
// ...
44+
45+
// Set tracesSampleRate to 1.0 to capture 100%
46+
// of transactions for performance monitoring.
47+
// We recommend adjusting this value in production
48+
tracesSampleRate: 1.0,
5449
});
5550
```
5651

@@ -59,15 +54,10 @@ import * as Sentry from "@sentry/gatsby";
5954

6055
Sentry.init({
6156
dsn: "___PUBLIC_DSN___",
62-
tracesSampleRate: 1.0, // Adjust this value in production
63-
beforeSend(event) {
64-
// Modify the event here
65-
if (event.user) {
66-
// Don't send user's email address
67-
delete event.user.email;
68-
}
69-
return event;
70-
},
71-
// ...
57+
58+
// Set tracesSampleRate to 1.0 to capture 100%
59+
// of transactions for performance monitoring.
60+
// We recommend adjusting this value in production
61+
tracesSampleRate: 1.0,
7262
});
7363
```

src/wizard/javascript/gatsby.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,29 @@ npm install --save @sentry/gatsby
1717

1818
## Connecting the SDK to Sentry
1919

20-
Register the plugin in your Gatsby configuration file (typically `gatsby-config.js`).
20+
Register the `@sentry/gatsby` plugin in your Gatsby configuration file (typically `gatsby-config.js`).
2121

2222
```javascript {filename:gatsby-config.js}
2323
module.exports = {
24-
// ...
2524
plugins: [
2625
{
2726
resolve: "@sentry/gatsby",
28-
options: {
29-
dsn: "___PUBLIC_DSN___",
30-
sampleRate: 0.7,
31-
},
3227
},
33-
// ...
3428
],
3529
};
3630
```
31+
32+
Then, configure your `Sentry.init`:
33+
34+
```javascript {filename:sentry.config.js}
35+
import * as Sentry from "@sentry/gatsby";
36+
37+
Sentry.init({
38+
dsn: "___PUBLIC_DSN___",
39+
40+
// Set tracesSampleRate to 1.0 to capture 100%
41+
// of transactions for performance monitoring.
42+
// We recommend adjusting this value in production
43+
tracesSampleRate: 1.0,
44+
});
45+
```

src/wizard/javascript/replay-onboarding/gatsby/2.configure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: language
99

1010
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set using the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/gatsby/session-replay/).
1111

12-
Include the `@sentry/gatsby` plugin:
12+
Register the `@sentry/gatsby` plugin in your Gatsby configuration file (typically `gatsby-config.js`).
1313

1414
```javascript {filename:gatsby-config.js}
1515
module.exports = {

0 commit comments

Comments
 (0)