You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want users to only use the `sentry.config.ts` method, not the plugin options method, so remove it from the docs. Version 7 has been out long enough that this should be safe to do.
Copy file name to clipboardExpand all lines: src/platforms/javascript/guides/gatsby/index.mdx
+2-47Lines changed: 2 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,7 @@ yarn add @sentry/gatsby
22
22
23
23
</Note>
24
24
25
-
## Connecting the SDK to Sentry
26
-
27
-
You can configure the SDK in one of two ways discussed below: by creating a configuration file, or defining the options along with the Gatsby configuration. If you define options in both places, the SDK will prioritize the `init` in the configuration file and ignore the options in the Gatsby configuration.
28
-
29
-
### Sentry Configuration File
30
-
31
-
<Note>
32
-
33
-
The minimum version supporting the Sentry configuration file is `6.14.0`.
34
-
35
-
</Note>
36
-
37
-
Using a Sentry configuration file is the approach we recommend since it supports defining non-serializable options in the `init`. Note that you still need to include the plugin, even if you don't set any options.
25
+
First add `@sentry/gatsby` as a plugin to your `gatsby-config.js`.
38
26
39
27
```javascript {filename:gatsby-config.js}
40
28
module.exports= {
@@ -46,7 +34,7 @@ module.exports = {
46
34
};
47
35
```
48
36
49
-
Configure your `Sentry.init`:
37
+
Then, configure your `Sentry.init`:
50
38
51
39
```javascript {filename:sentry.config.js}
52
40
import*asSentryfrom"@sentry/gatsby";
@@ -83,36 +71,3 @@ Sentry.init({
83
71
// ...
84
72
});
85
73
```
86
-
87
-
### Gatsby Plugin Configuration
88
-
89
-
Another alternative is to use Gatsby's [plugin configuration options](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/using-a-plugin-in-your-site/#using-plugin-configuration-options). While this keeps the SDK options with the plugin definition, it doesn't support non-serializable options like `integrations`, `transport`, `stackParser`,`beforeSend`, `beforeSendTransaction`, and `tracesSampler`.
90
-
91
-
```javascript {filename:gatsby-config.js}
92
-
module.exports= {
93
-
plugins: [
94
-
{
95
-
resolve:"@sentry/gatsby",
96
-
options: {
97
-
dsn:"___PUBLIC_DSN___",
98
-
tracesSampleRate:1.0, // Adjust this value in production
99
-
// Cannot set any non-serializable options
100
-
},
101
-
},
102
-
],
103
-
};
104
-
```
105
-
106
-
With this approach, the SDK sets some options automatically based on environmental variables, but these can be overridden by setting custom options.
107
-
108
-
`environment` (string)
109
-
110
-
: Defaults to `process.env.NODE_ENV` or `development`
111
-
112
-
`release` (string)
113
-
114
-
: Defaults to certain environment variables based on the platform
0 commit comments