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
Copy file name to clipboardExpand all lines: docs/content/en/configuration/options.md
+16-33Lines changed: 16 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
title: Options
3
3
description: 'Options can be passed to Sentry using either environment variables'
4
-
position: 4
5
-
category: Sentry
4
+
position: 15
5
+
category: Configuration
6
6
---
7
7
8
8
Options can be passed using either:
9
9
- environment variables
10
10
-`sentry` object in `nuxt.config.js`
11
11
- when registering the module: `modules: [['@nuxtjs/sentry', {/*options*/}]]`
12
12
13
-
The `config`, `serverConfig` and `clientConfig` options can also be configured using [Runtime Config](/sentry/runtime-config).
13
+
The `config`, `serverConfig` and `clientConfig` options can also be configured using [Runtime Config](/configuration/runtime-config).
14
14
15
15
The `dsn` is the only option that is required to enable Sentry reporting.
16
16
@@ -123,13 +123,13 @@ The `dsn` is the only option that is required to enable Sentry reporting.
123
123
- Default: `sentry`
124
124
- Specified object in Nuxt config in `publicRuntimeConfig[runtimeConfigKey]` will override some options at runtime. See documentation at https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-runtime-config/
125
125
- Used to define the environment at runtime for example
126
-
- See also [Runtime Config](/sentry/runtime-config) documentation.
126
+
- See also [Runtime Config](/configuration/runtime-config) documentation.
127
127
128
128
### disabled
129
129
130
130
- Type: `Boolean`
131
131
- Default: `process.env.SENTRY_DISABLED || false`
132
-
- Sentry will not be initialised if set to `true`.
132
+
- Sentry will not be initialized if set to `true`.
133
133
134
134
### disableClientSide
135
135
@@ -207,22 +207,22 @@ Note that the module sets the following defaults when publishing is enabled:
207
207
208
208
- Type:`String`
209
209
- Default:`source-map`
210
-
- Only has effect when `publishRelease = true`
210
+
- Only has effect when `publishRelease` is enabled
211
211
- The type of source maps generated when publishing release to Sentry. See https://webpack.js.org/configuration/devtool for a list of available options
212
212
-**Note**: Consider using `hidden-source-map`instead. For most people, that should be a better option but due to it being a breaking change, it won't be set as the default until next major release
- Only has effect when `publishRelease` is enabled
226
226
- See https://docs.sentry.io/workflow/releases for more information
227
227
228
228
### clientIntegrations
@@ -238,9 +238,9 @@ Note that the module sets the following defaults when publishing is enabled:
238
238
```
239
239
- Sentry by default also enables the following browser integrations: `Breadcrumbs`, `Dedupe`, `FunctionToString`, `GlobalHandlers`, `HttpContext`, `InboundFilters`, `LinkedErrors`, `TryCatch`.
240
240
- When `tracing` option is enabled then the [Vue Router Instrumentation](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/vue-router/) is also enabled.
241
-
- The full list of client integrations that are supported: `Breadcrumbs`, `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `FunctionToString`, `GlobalHandlers`, `HttpClient`, `HttpContext`, `InboundFilters`, `LinkedErrors`, `ReportingObserver`, `RewriteFrames`, `TryCatch`.
241
+
- The full list of client integrations that are supported: `Breadcrumbs`, `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `FunctionToString`, `GlobalHandlers`, `HttpClient`, `HttpContext`, `InboundFilters`, `LinkedErrors`, `Reply`, `ReportingObserver`, `RewriteFrames`, `TryCatch`.
242
242
- Integration options can be specified in the object value corresponding to the individual integration key.
243
-
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
243
+
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only) set the option to:
244
244
```js
245
245
{
246
246
ExtraErrorData: false,
@@ -265,7 +265,7 @@ Note that the module sets the following defaults when publishing is enabled:
265
265
- Sentry by default enables the following server integrations: `Console`, `ContextLines`, `Context`, `FunctionToString`, `Http`, `InboundFilters`, `LinkedErrors`, `Modules`,`OnUncaughtException`, `OnUnhandledRejection`, `RequestData`.
266
266
- The full list of server integrations that are supported includes the ones above plus: `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `RewriteFrames`, `Transaction`.
267
267
- Integration options can be specified in the object value corresponding to the individual integration key.
268
-
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
268
+
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only) set the option to:
269
269
```js
270
270
{
271
271
Dedupe: {},
@@ -313,7 +313,7 @@ export default function () {
313
313
- Type: `Boolean` or `Object`
314
314
- Default: `false`
315
315
316
-
- Enables Sentry Performance Monitoring on the [server](https://docs.sentry.io/platforms/node/performance/) and [browser](https://docs.sentry.io/platforms/javascript/guides/vue/performance/) side.
316
+
- Enables Sentry Performance Monitoring on the [server](https://docs.sentry.io/platforms/node/guides/express/performance/) and [browser](https://docs.sentry.io/platforms/javascript/guides/vue/performance/) side.
317
317
- Takes the following object configuration format (default values shown):
318
318
```js
319
319
{
@@ -326,6 +326,8 @@ export default function () {
326
326
```
327
327
- On the browser side the `BrowserTracing` integration is enabled by default and adds automatic instrumentation for monitoring the performance of the application. The [Vue Router Integration](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/vue-router/) is also automatically enabled. See all available [`BrowserTracing` options](https://docs.sentry.io/platforms/javascript/guides/vue/performance/instrumentation/automatic-instrumentation/).
328
328
- On the browser side extra options for [Tracking Vue components](https://docs.sentry.io/platforms/javascript/guides/vue/features/component-tracking/) can be passed through the `vueOptions` object.
329
+
- On the server side the `Http` integration is enabled to trace HTTP requests and [tracingHandler](https://docs.sentry.io/platforms/node/guides/express/performance/) is enabled to trace `connect` and `express` routes.
330
+
- See also the [Performance Monitoring](/guide/performance) section for more information.
- The specified keys will override common options set in the `config` key.
380
-
- The value can be a string in which case it needs to be a file path (can use [webpack aliases](https://nuxtjs.org/docs/2.x/directory-structure/assets#aliases)) pointing to a javascript file whose default export (a function) returns the configuration object. This is necessary in case some of the options rely on imported values or can't be serialized. The function is passed a `Nuxt Context` argument and can be `async`. Example of how to enable [User Feedback](https://docs.sentry.io/platforms/javascript/enriching-events/user-feedback/) dialog:
381
-
```js [nuxt.config.js]
382
-
sentry: {
383
-
dsn: '...',
384
-
clientConfig: '~/config/sentry-client-config.js',
385
-
}
386
-
```
387
-
```js [~/config/sentry-client-config.js]
388
-
import { showReportDialog } from '@sentry/vue'
389
-
390
-
export default function(context) {
391
-
return {
392
-
beforeSend (event, hint) {
393
-
if (event.exception) {
394
-
showReportDialog({ eventId: event.event_id })
395
-
}
396
-
return event
397
-
},
398
-
}
399
-
}
400
-
```
382
+
- The value can be a string in which case it needs to be a file path (can use [webpack aliases](https://nuxtjs.org/docs/2.x/directory-structure/assets#aliases)) pointing to a javascript file whose default export (a function) returns the configuration object. This is necessary in case some of the options rely on imported values or can't be serialized. The function is passed a `Nuxt Context` argument and can be `async`.
383
+
- See an example usage on the [User Feedback](/guide/user-feedback) page.
Copy file name to clipboardExpand all lines: docs/content/en/configuration/runtime-config.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Runtime config
3
3
description: "Load Sentry configuration at runtime"
4
-
position: 5
5
-
category: Sentry
4
+
position: 16
5
+
category: Configuration
6
6
---
7
7
8
8
Defining options using the [Nuxt Runtime Config](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-runtime-config/) functionality allows them to be runtime-based rather than build-time based, as is the case by default.
9
9
10
-
Currently only the `config`, `clientConfig` and `serverConfig`[options](/sentry/options) can be configured using the runtime config.
10
+
Currently, only the `config`, `clientConfig` and `serverConfig`[options](/configuration/options) can be configured using the runtime config.
11
11
12
12
In the Nuxt configuration file define a `publicRuntimeConfig.sentry` configuration object with settings that will be applied at runtime. For example:
13
13
@@ -27,6 +27,6 @@ publicRuntimeConfig: {
27
27
}
28
28
```
29
29
30
-
You can customize the key that is used to access settings from `publicRuntimeConfig` by setting [`runtimeConfigKey`](/sentry/options#runtimeconfigkey) in the non-runtime options.
30
+
You can customize the key that is used to access settings from `publicRuntimeConfig` by setting [`runtimeConfigKey`](/configuration/options#runtimeconfigkey) in the non-runtime options.
31
31
32
32
This functionality is supported from Nuxt 2.13 and up.
Copy file name to clipboardExpand all lines: docs/content/en/getting-started/setup.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Setup
3
3
description: 'Setup the sentry module into Nuxt'
4
-
position: 2
5
-
category: Guide
4
+
position: 10
5
+
category: Getting Started
6
6
---
7
7
8
8
Check the [Nuxt.js documentation](https://nuxtjs.org/guides/configuration-glossary/configuration-modules) for more information about installing and using modules in Nuxt.js.
9
9
10
-
> Nuxt.js v2.4.0+ is required, earlier versions are not supported
10
+
> Nuxt.js v2.16.0+ is required, earlier versions are not supported.
11
11
12
12
## Installation
13
13
@@ -44,7 +44,7 @@ Then, add `@nuxtjs/sentry` to the `modules` section of `nuxt.config.js` and set
44
44
}
45
45
```
46
46
47
-
See [Options](/sentry/options) for a list of available options.
47
+
See [Options](/configuration/options) for a list of available options.
48
48
49
49
Note that the Sentry SDK dependencies (`@sentry/*`) are not pinned and can be updated independently from the module itself by running `npm upgrade @nuxtjs/sentry` or `yarn upgrade @nuxtjs/sentry`. That means you don't have to wait for a new module release if you want to update to the latest SDK version.
50
50
@@ -67,6 +67,6 @@ In Typescript or type-checked JavaScript projects, add `@nuxtjs/sentry` to the `
67
67
68
68
The otherwise optional package `@sentry/webpack-plugin` has to be installed for types to be fully working.
69
69
70
-
If not using the relevant functionality (`tracing` and `publishRelease`options are not enabled) then those packages can be installed as dev-only dependencies.
70
+
If not using the relevant functionality (`publishRelease`option is not enabled) then this package can be installed as dev-only dependency.
Copy file name to clipboardExpand all lines: docs/content/en/guide/lazy-loading.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Lazy-Loading (client-side)
3
-
description: 'Load Sentry module lazily on the client'
4
-
position: 6
5
-
category: Sentry
3
+
description: Load Sentry module lazily on the client
4
+
position: 22
5
+
category: Guide
6
6
---
7
7
8
8
Set `lazy: true` in your module options to load Sentry lazily on the client. This will prevent Sentry from being included in your main bundle and should result in a faster initial page load.
9
9
10
-
You can also pass a lazy config object in your module options (see [options](/sentry/options#lazy) for more information).
10
+
You can also pass a lazy config object in your module options (see [options](/configuration/options#lazy) for more information).
11
11
12
12
<alerttype="info">
13
13
@@ -22,7 +22,7 @@ You can also pass a lazy config object in your module options (see [options](/se
22
22
23
23
Normally `$sentry` would always refer to the `@sentry/vue` API. But if we lazy load Sentry this API wont be available until Sentry has loaded. If you don't want to worry about whether Sentry is loaded or not, a mocked Sentry API is injected into the Nuxt.js context that will execute all Sentry API calls once Sentry is loaded
24
24
25
-
See: [`injectMock`](/sentry/options#lazy) and [`mockApiMethods`](/sentry/options#lazy) options.
25
+
See: [`injectMock`](/configuration/options#lazy) and [`mockApiMethods`](/configuration/options#lazy) options.
To automatically configure and enable performance monitoring, enable the [tracing](/configuration/options#tracing) option.
9
+
10
+
This enables various additional integrations for monitoring and instrumentation. On the client-side it enables [`BrowserTracing`](https://docs.sentry.io/platforms/javascript/guides/vue/performance/instrumentation/automatic-instrumentation/) and [`Vue Router Instrumentation`](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/vue-router/) integrations. On the server-side it enables the [`Http` and `tracingHandler`](https://docs.sentry.io/platforms/node/guides/express/performance/instrumentation/automatic-instrumentation/) integrations for tracing HTTP requests and `connect`/`express` routes.
11
+
12
+
See the description of the [tracing](/configuration/options#tracing) option if you want to customize some aspect of that functionality like the percentage of requests to capture.
13
+
14
+
<alerttype="info">
15
+
16
+
Note that the `tracesSampleRate` value can be between 0.0 and 1.0 (percentage of requests to capture) and Sentry documentation strongly recommends reducing the value from the default 1.0.
17
+
18
+
</alert>
19
+
20
+
See also Sentry's SDK [client](https://docs.sentry.io/platforms/javascript/guides/vue/performance/) and [server](https://docs.sentry.io/platforms/node/guides/express/performance/) Performance Monitoring pages for additional information about those integrations.
description: Record and replay user interactions that lead to an error
4
+
position: 24
5
+
category: Guide
6
+
---
7
+
8
+
Session Replay helps you get to the root cause of an error or latency issue faster by providing you with a video-like reproduction of what was happening in the user's browser before, during, and after the issue.
9
+
10
+
### Setup
11
+
12
+
Session Replay comes as a separate integration that is not enabled by default. To enable it, add `Replay: {}` to the [`clientIntegrations`](/configuration/options#clientintegrations) option like so:
13
+
14
+
```js [nuxt.config.js]
15
+
sentry: {
16
+
dsn:'...',
17
+
clientIntegrations: [
18
+
Reply: {},
19
+
],
20
+
clientConfig: {
21
+
// This sets the sample rate to be 10%. You may want this to be 100% while
22
+
// in development and sample at a lower rate in production
23
+
replaysSessionSampleRate:0.1,
24
+
// If the entire session is not sampled, use the below sample rate to sample
25
+
// sessions when an error occurs.
26
+
replaysOnErrorSampleRate:1.0,
27
+
}
28
+
}
29
+
```
30
+
31
+
You can customize integration options by passing them within the `{}` object.
32
+
33
+
<alerttype="info">
34
+
35
+
Note that the `replaysSessionSampleRate` and `replaysOnErrorSampleRate` options are part of the global client options and not options of the `Replay` integration itself.
36
+
37
+
</alert>
38
+
39
+
<alerttype="info">
40
+
41
+
Refer to the Sentry documentation below to make sure that Content Security Policy (CSP) is configured properly for allowing `Replay` integration to do its work.
42
+
43
+
</alert>
44
+
45
+
### Documentation
46
+
47
+
See Sentry's [Session Replay](https://docs.sentry.io/platforms/javascript/guides/vue/session-replay/) pages for additional information.
Copy file name to clipboardExpand all lines: docs/content/en/guide/usage.md
+2-14Lines changed: 2 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,14 @@
1
1
---
2
2
title: Usage / API
3
-
description: 'Usage of Sentry in Nuxt'
4
-
position: 3
3
+
description: Usage of Sentry in Nuxt
4
+
position: 20
5
5
category: Guide
6
6
---
7
7
8
8
### Automatic Capturing
9
9
10
10
Once enabled, Sentry automatically reports errors, uncaught exceptions and unhandled rejections. No need for further steps, unless you like to report (certain) exceptions manually or have deactivated integrations like `GlobalError`. In this case, find out below how to send reports manually.
11
11
12
-
### Enriching Reported Events
13
-
14
-
Sentry SDK provides API for enhancing events that are being reported. For example, you can:
15
-
- set user information like IP address or username using `Sentry.setUser` API
16
-
- add custom structured data using `Sentry.setContext` API
17
-
- set custom key/value pairs (tags) that get indexed and can be used for filtering and searching using `Sentry.setTag` API
18
-
- add file attachments using `scope.addAttachment` API
19
-
- manually add breadcrumbs using `Sentry.addBreadcrumb` API
20
-
- and other...
21
-
22
-
Read more about [Enriching Events](https://docs.sentry.io/platforms/javascript/guides/vue/enriching-events/).
23
-
24
12
### Usage in Vue components
25
13
26
14
In a Vue component, `Sentry` is available as `this.$sentry`, so we can call functions like
description: A feedback dialog for providing additional user information
4
+
position: 25
5
+
category: Guide
6
+
---
7
+
8
+
When a user experiences an error, Sentry provides the ability to collect additional feedback through a feedback dialog.
9
+
10
+
### Setup
11
+
12
+
`showReportDialog` is a function that should be called to trigger the User Feedback dialog. Due to how Nuxt works, we can't reference it directly from within Nuxt config as Sentry configuration is strinigified and the function reference does not survive that. We have to use the `clientConfig` option with a path to a custom client configuration that imports the function like so:
13
+
14
+
```js [nuxt.config.js]
15
+
sentry: {
16
+
dsn:'...',
17
+
clientConfig:'~/config/sentry-client-config.js',
18
+
}
19
+
```
20
+
21
+
```js [~/config/sentry-client-config.js]
22
+
import { showReportDialog } from'@sentry/vue'
23
+
24
+
exportdefaultfunction(context) {
25
+
return {
26
+
beforeSend (event, hint) {
27
+
if (event.exception) {
28
+
showReportDialog({ eventId:event.event_id })
29
+
}
30
+
returnevent
31
+
},
32
+
}
33
+
}
34
+
```
35
+
36
+
<alerttype="info">
37
+
38
+
The configuration provided through `clientConfig` is merged with the configuration provided in the Nuxt config so other configuration options can (but don't have to) be defined in Nuxt config.
39
+
40
+
</alert>
41
+
42
+
### Documentation
43
+
44
+
See Sentry's [User Feedback](https://docs.sentry.io/platforms/javascript/guides/vue/enriching-events/user-feedback/) pages for additional information.
0 commit comments