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
* fix/tree-shake:
feat: enable tree shaking of Sentry SDK debug code
chore(lint): enable linting for more files within the repo
chore(deps): update lock file
fix(deps): update sentry dependencies to ^7.28.0 (#478)
docs: minor updates about dependencies and lazy+tracing
feat: support plugin path for clientConfig and serverConfig (#477)
feat(tracing): enable Vue Router instrumentation by default (#476)
Revert "feat(tracing): enable Vue Router instrumentation by default"
feat(tracing): enable Vue Router instrumentation by default
chore(lint): tweak eslint ignore directives for generated plugin files
chore(deps): update devdependency sentry-testkit to v5
chore(deps): update devdependency @nuxtjs/eslint-config-typescript to v12
chore(deps): update sentry dependencies to ^7.27.0 (#474)
feat!: update Sentry SDK from v6 to v7 (#461)
docs: add information about enriching events (#473)
fix: gracefully handle Nuxt versions without Runtime Config (#472)
description: Follow this guide to upgrade from one major version to the other.
4
+
position: 10
5
+
category: Guide
6
+
---
7
+
8
+
Follow this guide to upgrade from one major version to the other.
9
+
10
+
## Upgrading from v6 to v7
11
+
12
+
Sentry SDK dependencies updated from v6 to v7. Please read about breaking changes in Sentry SDK's [Upgrading from v6.x to v7.x](https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md#upgrading-from-6x-to-7x) document.
13
+
14
+
Some of the breaking changes listed in that document are automatically handled by the module and don't need any action. Other notable changes that might require action are:
15
+
16
+
- When using the `tracing` option, the `@sentry/tracing` dependency needs to be upgraded from v6.x to v7.x.
17
+
- The `whitelistUrls` and `blacklistUrls` Sentry `config` (or `clientConfig` / `serverConfig`) options have been renamed to `allowUrls` and `denyUrls`.
18
+
- The `Vue` integration was removed as is now merged into the Sentry Browser SDK. If you have been passing custom `Vue` options through the `clientIntegrations.Vue` object then those can now be merged directly into the `clientConfig` option (without the parent `Vue` key).
19
+
- The `UserAgent` integration was renamed to `HttpContext`. If you have been passing custom configuration to that integration through `clientIntegrations` option then you should rename the key.
// Those options are shared by both the Browser and the Server instances.
46
+
// Browser-only and Server-only options should go
47
+
// into `clientConfig` and `serverConfig` objects respectively.
47
48
},
48
49
}
49
50
}
50
51
```
51
52
53
+
See [Options](/sentry/options) for a list of available options.
54
+
55
+
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 update @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.
56
+
52
57
<alerttype="info">
53
58
54
59
For Typescript or type-checked JavaScript projects, you might have to install the `@sentry/tracing` package even when not using the tracing functionality. In that case, the package can be installed as a dev-only dependency.
@@ -68,7 +73,3 @@ In Typescript or type-checked JavaScript projects, add `@nuxtjs/sentry` to the `
68
73
}
69
74
}
70
75
```
71
-
72
-
## Configuration
73
-
74
-
See [Options](/sentry/options) for a list of available options.
Copy file name to clipboardExpand all lines: docs/content/en/guide/usage.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,41 @@
1
1
---
2
-
title: Usage
3
-
description: 'Usage of Sentry into Nuxt'
2
+
title: Usage / API
3
+
description: 'Usage of Sentry in Nuxt'
4
4
position: 3
5
5
category: Guide
6
6
---
7
7
8
-
Enter your DSN in the Nuxt.js config file. Additional config options can be found [here](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/options/).
9
-
10
8
### Automatic Capturing
11
-
Once installed, 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 below how to send reports manually.
9
+
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
+
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/).
12
23
13
24
### Usage in Vue components
14
25
15
26
In a Vue component, `Sentry` is available as `this.$sentry`, so we can call functions like
Copy file name to clipboardExpand all lines: docs/content/en/sentry/lazy-loading.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ position: 6
5
5
category: Sentry
6
6
---
7
7
8
-
<alerttype="warning">
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
-
Please be aware that lazy loading could prevent some errors that happen early during app loading from being reported.
10
+
You can also pass a lazy config object in your module options (see [options](/sentry/options#lazy) for more information).
11
11
12
-
</alert>
12
+
<alerttype="info">
13
13
14
-
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 **but could result in some errors not being reported**.
14
+
Please be aware that lazy loading could prevent some errors that happen early during app loading from being reported and, if `tracing` is enabled, some performance metrics might not be accurate.
15
15
16
-
You can also pass a lazy config object in your module options (see [options](/sentry/options#lazy) for more information).
Copy file name to clipboardExpand all lines: docs/content/en/sentry/options.md
+68-27Lines changed: 68 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ Options can be passed using either:
12
12
13
13
The `config`, `serverConfig` and `clientConfig` options can also be configured using [Runtime Config](/sentry/runtime-config).
14
14
15
-
Normally, just setting DSN would be enough.
15
+
The `dsn` is the only option that is required to enable Sentry reporting.
16
16
17
17
### dsn
18
18
19
19
- Type: `String`
20
20
- Default: `process.env.SENTRY_DSN || ''`
21
-
- If no `dsn` is provided, Sentry will be initialised, but errors will not be logged. See [#47](https://github.com/nuxt-community/sentry-module/issues/47) for more information about this.
21
+
- If no `dsn` is provided then Sentry will be initialized using mocked instance to prevent the code that references `$sentry` from crashing. No errors will be reported using that mocked instance.
22
22
23
23
### lazy
24
24
@@ -123,6 +123,7 @@ Normally, just setting DSN would be enough.
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
127
127
128
### disabled
128
129
@@ -230,21 +231,23 @@ Note that the module sets the following defaults when publishing is enabled:
230
231
- Default:
231
232
```js
232
233
{
233
-
Dedupe: {},
234
234
ExtraErrorData: {},
235
235
ReportingObserver: {},
236
-
RewriteFrames: {}
236
+
RewriteFrames: {},
237
237
}
238
238
```
239
-
- Sentry by default also enables these browser integrations: `InboundFilters`, `FunctionToString`, `TryCatch`, `Breadcrumbs`, `GlobalHandlers`, `LinkedErrors`, `UserAgent`. Their options can be overridden by specifying them manually in the object.
240
-
- Here is the full list of client integrations that are supported: `Breadcrumbs`, `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `FunctionToString`, `GlobalHandlers`, `InboundFilters`, `LinkedErrors`, `ReportingObserver`, `RewriteFrames`, `TryCatch`, `UserAgent`, `Vue`.
241
-
- User-provided configuration is merged with the default configuration so to disable integration that is enabled by default, you have to pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
239
+
- Sentry by default also enables the following browser integrations: `InboundFilters`, `FunctionToString`, `TryCatch`, `Breadcrumbs`, `GlobalHandlers`, `LinkedErrors`, `Dedupe`, `HttpContext`.
240
+
- The full list of client integrations that are supported: `Breadcrumbs`, `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `FunctionToString`, `GlobalHandlers`, `HttpContext`, `InboundFilters`, `LinkedErrors`, `ReportingObserver`, `RewriteFrames`, `TryCatch`.
241
+
- Integration options can be specified in the object value corresponding to the individual integration key.
242
+
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
242
243
```js
243
244
{
244
-
ExtraErrorData: false
245
+
ExtraErrorData: false,
246
+
ReportingObserver: {},
247
+
RewriteFrames: {},
245
248
}
246
249
```
247
-
- See https://docs.sentry.io/platforms/javascript/configuration/integrations/default/ and https://docs.sentry.io/platforms/javascript/configuration/integrations/plugin/ for more information on the integrations and their configuration
250
+
- See also [Sentry Browser Integrations](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/) for more information on configuring each integration.
248
251
249
252
### serverIntegrations
250
253
@@ -255,17 +258,20 @@ Note that the module sets the following defaults when publishing is enabled:
255
258
Dedupe: {},
256
259
ExtraErrorData: {},
257
260
RewriteFrames: {},
258
-
Transaction: {}
259
261
}
260
262
```
261
-
- Here is the full list of server integrations that are supported: `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `RewriteFrames`, `Modules`, `Transaction`.
262
-
- User-provided configuration is merged with the default configuration so to disable integration that is enabled by default, you have to pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
263
+
- Sentry by default also enables the following server integrations: `InboundFilters`, `FunctionToString`, `Console`, `Http`, `OnUncaughtException`, `OnUnhandledRejection`, `ContextLines`, `Context`, `Modules`, `RequestData`, `LinkedErrors`.
264
+
- The full list of server integrations that are supported includes the ones above plus: `CaptureConsole`, `Debug`, `Dedupe`, `ExtraErrorData`, `RewriteFrames`, `Transaction`.
265
+
- Integration options can be specified in the object value corresponding to the individual integration key.
266
+
- To disable integration that is enabled by default, pass `false` as a value. For example to disable `ExtraErrorData` integration (only), set the option to:
263
267
```js
264
268
{
265
-
ExtraErrorData: false
269
+
Dedupe: {},
270
+
ExtraErrorData: false,
271
+
RewriteFrames: {},
266
272
}
267
273
```
268
-
- See https://docs.sentry.io/platforms/node/pluggable-integrations/ for more information on the integrations and their configuration
274
+
- See also [Sentry Server Integrations](https://docs.sentry.io/platforms/node/configuration/integrations/) for more information on configuring each integration.
269
275
270
276
### customClientIntegrations
271
277
@@ -306,21 +312,29 @@ export default function () {
306
312
307
313
<alert type="info">
308
314
309
-
`@sentry/tracing@7` (version 7 and not newer) should be installed manually when using this option.
315
+
`@sentry/tracing@7` (version 7) should be installed manually when using this option.
310
316
311
317
</alert>
312
318
313
-
- Enables the BrowserTracing integration for client performance monitoring
319
+
- 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.
314
320
- Takes the following object configuration format (default values shown):
315
321
```js
316
322
{
317
323
tracesSampleRate: 1.0,
318
-
trackComponents: true
319
-
browserTracing: {}
324
+
browserTracing: {},
325
+
vueOptions: {
326
+
trackComponents: true,
327
+
},
320
328
}
321
329
```
322
-
- Sentry documentation strongly recommends reducing the `tracesSampleRate` value; it should be between 0.0 and 1.0 (percentage of requests to capture)
323
-
- See available [browserTracing options](https://docs.sentry.io/platforms/javascript/guides/vue/performance/instrumentation/automatic-instrumentation/#configuration-options)
330
+
- 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/).
331
+
- 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.
332
+
333
+
<alert type="info">
334
+
335
+
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.
336
+
337
+
</alert>
324
338
325
339
### config
326
340
@@ -331,22 +345,49 @@ export default function () {
- Sentry options common to the server and client that are passed to `Sentry.init(options)`. See Sentry documentation at https://docs.sentry.io/platforms/javascript/guides/vue/configuration/options/
335
-
- Note that `config.dsn` is automatically set based on the root `dsn` option
336
-
- The value for `config.release` is automatically inferred from the local repo unless specified manually
337
-
- Do not use `config.integrations`, use clientIntegrations or serverIntegrations
348
+
- Sentry options common to the Server and Browser SDKs that are passed to `Sentry.init()`. See Sentry's documentation for [Basic Browser Options](https://docs.sentry.io/platforms/javascript/guides/vue/configuration/options/) and [Basic Server Options](https://docs.sentry.io/platforms/node/configuration/options/).
349
+
- Note that `config.dsn` is automatically set based on the root `dsn` option.
350
+
- The value for`config.release` is automatically inferred from the local repo unless specified manually.
351
+
- Do not set`config.integrations`, use `clientIntegrations` and `serverIntegrations` options instead.
338
352
339
353
### serverConfig
340
354
341
355
- Type:`Object`
342
356
- Default:`{}`
343
-
- Specified key will override common Sentry options for server sentry plugin
357
+
- Sentry SDK [Basic Server Options](https://docs.sentry.io/platforms/node/configuration/options/).
358
+
- The specified keys will override common options set in the `config` key.
359
+
- 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 can be `async`. Artificial example that switches out the `transport`:
360
+
```js [~/config/sentry-server-config.js]
361
+
import { makeNodeTransport } from '@sentry/node'
362
+
363
+
export default function() {
364
+
return {
365
+
transport: makeNodeTransport,
366
+
}
367
+
}
368
+
```
344
369
345
370
### clientConfig
346
371
347
-
- Type: `Object`
372
+
- Type:`Object` or `String`
348
373
- Default:`{}`
349
-
- Specified keys will override common Sentry options for client sentry plugin
- The specified keys will override common options set in the `config` key.
376
+
- 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:
Copy file name to clipboardExpand all lines: docs/content/en/sentry/runtime-config.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,5 @@ publicRuntimeConfig: {
28
28
```
29
29
30
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.
31
+
32
+
This functionality is supported from Nuxt 2.13 and up.
0 commit comments