Skip to content

Commit 1a17183

Browse files
authored
docs(js): Add Meta-framework settings for filter integration (#12940)
1 parent 43c01de commit 1a17183

File tree

7 files changed

+121
-52
lines changed

7 files changed

+121
-52
lines changed

docs/platforms/javascript/common/configuration/filtering.mdx

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -103,58 +103,7 @@ This allows you to filter out errors with "unmarked" stack frames, which would i
103103
To set up this integration and to mark your JavaScript files with an application key, first pass an `applicationKey` option to your Sentry bundler plugin.
104104
This can be an arbitrary string that identifies your application code:
105105

106-
```ts {tabTitle:Vite} {8}
107-
// vite.config.ts
108-
import { defineConfig } from "vite";
109-
import { sentryVitePlugin } from "@sentry/vite-plugin";
110-
111-
export default defineConfig({
112-
plugins: [
113-
sentryVitePlugin({
114-
applicationKey: "your-custom-application-key",
115-
}),
116-
],
117-
});
118-
```
119-
120-
```js {tabTitle:Webpack} {7}
121-
// webpack.config.js
122-
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
123-
124-
module.exports = {
125-
plugins: [
126-
sentryWebpackPlugin({
127-
applicationKey: "your-custom-application-key",
128-
}),
129-
],
130-
};
131-
```
132-
133-
```js {tabTitle:esbuild} {7}
134-
// esbuild.config.js
135-
const { sentryEsbuildPlugin } = require("@sentry/esbuild-plugin");
136-
137-
require("esbuild").build({
138-
plugins: [
139-
sentryEsbuildPlugin({
140-
applicationKey: "your-custom-application-key",
141-
}),
142-
],
143-
});
144-
```
145-
146-
```js {tabTitle:Rollup} {7}
147-
// rollup.config.mjs
148-
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
149-
150-
export default {
151-
plugins: [
152-
sentryRollupPlugin({
153-
applicationKey: "your-custom-application-key",
154-
}),
155-
],
156-
};
157-
```
106+
<PlatformContent includePath="configuration/filter-application-key" />
158107

159108
Next, add the `thirdPartyErrorFilterIntegration` to your Sentry initialization:
160109

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
```ts {tabTitle:Vite} {8}
2+
// vite.config.ts
3+
import { defineConfig } from "vite";
4+
import { sentryVitePlugin } from "@sentry/vite-plugin";
5+
6+
export default defineConfig({
7+
plugins: [
8+
sentryVitePlugin({
9+
applicationKey: "your-custom-application-key",
10+
}),
11+
],
12+
});
13+
```
14+
15+
```js {tabTitle:Webpack} {7}
16+
// webpack.config.js
17+
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
18+
19+
module.exports = {
20+
plugins: [
21+
sentryWebpackPlugin({
22+
applicationKey: "your-custom-application-key",
23+
}),
24+
],
25+
};
26+
```
27+
28+
```js {tabTitle:esbuild} {7}
29+
// esbuild.config.js
30+
const { sentryEsbuildPlugin } = require("@sentry/esbuild-plugin");
31+
32+
require("esbuild").build({
33+
plugins: [
34+
sentryEsbuildPlugin({
35+
applicationKey: "your-custom-application-key",
36+
}),
37+
],
38+
});
39+
```
40+
41+
```js {tabTitle:Rollup} {7}
42+
// rollup.config.mjs
43+
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
44+
45+
export default {
46+
plugins: [
47+
sentryRollupPlugin({
48+
applicationKey: "your-custom-application-key",
49+
}),
50+
],
51+
};
52+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```javascript {tabTitle:CJS} {filename:next.config.js} {3}
2+
module.exports = withSentryConfig(nextConfig, {
3+
unstable_sentryWebpackPluginOptions: {
4+
applicationKey: "your-custom-application-key",
5+
},
6+
});
7+
```
8+
9+
```javascript {tabTitle:ESM} {filename:next.config.mjs} {3}
10+
export default withSentryConfig(nextConfig, {
11+
unstable_sentryWebpackPluginOptions: {
12+
applicationKey: "your-custom-application-key",
13+
},
14+
});
15+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
```javascript {tabTitle:Nuxt Config} {filename:nuxt.config.ts} {4}
2+
export default defineNuxtConfig({
3+
sentry: {
4+
unstable_sentryBundlerPluginOptions: {
5+
applicationKey: "your-custom-application-key",
6+
},
7+
},
8+
});
9+
10+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```js {tabTitle:Vite} {filename:vite.config.ts} {3}
2+
const sentryConfig = {
3+
unstable_sentryVitePluginOptions: {
4+
applicationKey: "your-custom-application-key",
5+
},
6+
};
7+
8+
export default defineConfig((config) => {
9+
return {
10+
plugins: [reactRouter(), sentryReactRouter(sentryConfig, config)],
11+
sentryConfig,
12+
};
13+
});
14+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```js {tabTitle:Vite} {filename:app.config.ts} {9}
2+
export default defineConfig(
3+
withSentry(
4+
{
5+
/* Your SolidStart config */
6+
},
7+
{
8+
sourceMapsUploadOptions: {
9+
unstable_sentryVitePluginOptions: {
10+
applicationKey: "your-custom-application-key",
11+
},
12+
},
13+
},
14+
),
15+
);
16+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
```js {tabTitle:Vite} {filename:vite.config.js} {6}
2+
export default defineConfig({
3+
plugins: [
4+
sentrySvelteKit({
5+
sourceMapsUploadOptions: {
6+
unstable_sentryVitePluginOptions: {
7+
applicationKey: "your-custom-application-key",
8+
},
9+
},
10+
})
11+
]
12+
});
13+
```

0 commit comments

Comments
 (0)