Skip to content

Commit 960b616

Browse files
authored
fix(gatsby): Remove plugin configuration docs (#6246)
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.
1 parent fe1dc38 commit 960b616

File tree

1 file changed

+2
-47
lines changed
  • src/platforms/javascript/guides/gatsby

1 file changed

+2
-47
lines changed

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

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

2323
</Note>
2424

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`.
3826

3927
```javascript {filename:gatsby-config.js}
4028
module.exports = {
@@ -46,7 +34,7 @@ module.exports = {
4634
};
4735
```
4836

49-
Configure your `Sentry.init`:
37+
Then, configure your `Sentry.init`:
5038

5139
```javascript {filename:sentry.config.js}
5240
import * as Sentry from "@sentry/gatsby";
@@ -83,36 +71,3 @@ Sentry.init({
8371
// ...
8472
});
8573
```
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
115-
116-
- GitHub Actions: `process.env.GITHUB_SHA`
117-
- Netlify: `process.env.COMMIT_REF`
118-
- Vercel: `process.env.VERCEL_GIT_COMMIT_SHA`

0 commit comments

Comments
 (0)