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
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
23
23
24
-
<Expandabletitle="Want to learn more about these features?">
This guide assumes that you enable all features and allow the wizard to create an example page and route. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later.
description: Nuxt is a framework for full-stack web apps and websites. Learn how to set it up with Sentry.
3
+
description: Learn how to set up and configure Sentry in your Nuxt application using the installation wizard, capture your first errors, and view them in Sentry.
4
4
sdk: sentry.javascript.nuxt
5
5
categories:
6
6
- javascript
@@ -9,128 +9,90 @@ categories:
9
9
---
10
10
11
11
<Alertlevel="warning">
12
-
This SDK is currently in **beta**. Beta features are still in progress and may have bugs. Please reach out on
13
-
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns.
12
+
This SDK is currently in **beta**. Beta features are still in progress and may
13
+
have bugs. Please reach out on
14
+
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if
15
+
you have any feedback or concerns.
14
16
</Alert>
15
17
16
-
Sentry's Nuxt SDK enables automatic reporting of errors and performance data.
17
-
18
-
## Compatibility
19
-
20
-
The Sentry Nuxt SDK supports Nuxt version `3.7.0` and above. For best results, we recommend
21
-
using Nuxt `3.14.0` or later, which includes updated dependencies critical to the SDK's functionality.
Sentry captures data by using an SDK within your application’s runtime.
20
+
## Step 1: Install
28
21
29
-
We recommend installing the SDK by running our installation wizard in the root directory of your project:
22
+
To install Sentry using the installation wizard, run the following command within your project:
30
23
31
24
```bash
32
25
npx @sentry/wizard@latest -i nuxt
33
26
```
34
27
35
-
The wizard will prompt you to log in to Sentry. It will then automatically do the following steps for you:
28
+
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
36
29
37
-
- create or update Nuxt files with the default Sentry configuration:
38
-
-`sentry.(client|server).config.ts` to initialize the SDK
39
-
-`nuxt.config.ts` to add build options to add source maps upload and auto-instrumentation via Vite plugins.
40
-
- create a `.env.sentry-build-plugin` file with an auth token to upload source maps (this file is automatically added to `.gitignore`)
41
-
- add an example page to your frontend app and your server to verify your Sentry setup
After the wizard setup is completed, the SDK will automatically capture unhandled errors, and monitor performance.
32
+
This guide assumes that you enable all features and allow the wizard to create an example page or component. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later.
44
33
45
-
You can also <PlatformLinkto="/usage/">manually capture errors</PlatformLink>.
34
+
<Expandabletitle="What does the installation wizard change inside your application?">
35
+
- Creates `sentry.(client|server).config.ts` to initialize the SDK
36
+
- Creates or updates your `nuxt.config.ts` to add build options to add source maps upload and auto-instrumentation via Vite plugins
37
+
- Creates `.env.sentry-build-plugin` with an auth token to upload source maps (this file is automatically added to `.gitignore`)
38
+
- Adds an example page and route to your application to help verify your Sentry setup
39
+
- If it couldn't create a page, the wizard adds an example component instead
46
40
47
-
<Alert>
48
-
If the setup through the wizard doesn't work for you, you can also <PlatformLinkto="/manual-setup/">set up the SDK manually</PlatformLink>.
49
-
</Alert>
41
+
</Expandable>
50
42
51
-
## Configure
43
+
## Step 2: Verify Your Setup
52
44
53
-
Configuration should happen as early as possible in your application's lifecycle.
45
+
If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page created by the installation wizard.
54
46
55
-
To complete your configuration, add <PlatformLinkto="/configuration/options/">options</PlatformLink> to your `Sentry.init()` calls.
47
+
<Expandablelevel="warning"title="The wizard created an example component instead of a page.">
48
+
The wizard creates a `SentryErrorButton` component when it fails to add an example page to your project. This usually happens if you don't have a `app.vue` file or if that file does not contain the `NuxtPage` component. To verify your setup, follow these steps before continuing with the next section, "View Captured Data in Sentry":
56
49
57
-
Here, you'll also be able to set context data, which includes data about the <PlatformLinkto="/enriching-events/identify-user/">user</PlatformLink>, <PlatformLinkto="/enriching-events/tags/">tags</PlatformLink>, or even <PlatformLinkto="/enriching-events/context/">arbitrary data</PlatformLink>, all of which will be added to every event sent to Sentry.
50
+
1. Add the `SentryErrorButton` component to a page and open it in your browser. For most Nuxt applications, this will be at localhost.
51
+
2. Click the "Throw Sample Error" button, which triggers an error and starts a performance trace on the client side.
58
52
59
-
## Verify
53
+
To test the server side as well, refer to the "Verify" section in the [Manual setup guide](/platforms/javascript/guides/nuxt/manual-setup/).
60
54
61
-
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
55
+
</Expandable>
62
56
63
-
### Server-side
57
+
To test Sentry on the server side, you first need to build your project since Sentry's server-side monitoring **doesn't work in development mode**.\
58
+
Then run your project and make sure to load Sentry on the server side by explicitly adding it via [`--import`](/platforms/javascript/guides/nuxt/install/cli-import/):
64
59
65
-
Sentry can only be loaded on the server-side by being explicitly added via `--import`.
66
-
Check out the <PlatformLinkto="/install/cli-import">`--import` CLI flag</PlatformLink> docs for setup instructions.
60
+
```
61
+
# Start your app after building your project with `nuxi build`
Sentry captures both of these errors for you. Additionally, the button click starts a performance trace to measure the time it takes for the API request to complete.
81
73
82
-
<Alertlevel="warning">
83
-
Sentry server-side monitoring **doesn't work in development mode!**
74
+
### View Captured Data in Sentry
84
75
85
-
If you experience any issues with the server-side setup, check out <PlatformLinkto="/troubleshooting">Troubleshooting</PlatformLink>
86
-
or read through the different <PlatformLinkto="/install">installation methods</PlatformLink>.
87
-
</Alert>
76
+
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).
Learn more about manually capturing an error or message in our <PlatformLinkto="/usage/">Usage documentation</PlatformLink>.
84
+
At this point, you should have integrated Sentry into your Nuxt application and should already be sending error and performance data to your Sentry project.
127
85
128
-
</Alert>
86
+
Now's a good time to customize your setup and look into more advanced topics. Our next recommended steps for you are:
129
87
130
-
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
88
+
- Learn how to [manually capture errors](/platforms/javascript/guides/nuxt/usage/)
89
+
- Continue to [customize your configuration](/platforms/javascript/guides/nuxt/configuration/)
90
+
- Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts
91
+
- Learn how to [track your Vue components or your Pinia store](/platforms/javascript/guides/nuxt/features/)
131
92
132
-
## Next Steps
93
+
<Expandablepermalink={false}title="Are you having problems setting up the SDK?">
94
+
95
+
- If you encountered issues with our installation wizard, try [setting up Sentry manually](/platforms/javascript/guides/nuxt/manual-setup/)
uncaught exceptions, and unhandled rejections. If you have something that
5
+
looks like an exception, Sentry can capture it.
6
+
-[**Tracing**](/product/tracing): Track software performance while seeing the
7
+
impact of errors across multiple systems. For example, distributed tracing
8
+
allows you to follow a request from the frontend to the backend and back.
9
+
-[**Profiling**](/product/explore/profiling/): Gain deeper insight than traditional tracing without custom instrumentation, letting you discover slow-to-execute or resource-intensive functions in your app.
uncaught exceptions, and unhandled rejections. If you have something that
15
-
looks like an exception, Sentry can capture it.
16
-
-[**Tracing**](/product/tracing): Track software performance while seeing the
17
-
impact of errors across multiple systems. For example, distributed tracing
18
-
allows you to follow a request from the frontend to the backend and back.
19
-
-[**Profiling**](/product/explore/profiling/): Gain deeper insight than traditional tracing without custom instrumentation, letting you discover slow-to-execute or resource-intensive functions in your app.
@@ -78,13 +68,7 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
78
68
79
69
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).
80
70
81
-
<Expandabletitle="Need help locating the captured errors in your Sentry project?">
82
-
83
-
1. Open the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues) page and select an error from the issues list to view the full details and context of this error. For an interactive UI walkthrough, click [here](/product/sentry-basics/integrate-frontend/generate-first-error/#ui-walkthrough).
84
-
2. Open the [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/traces) page and select a trace to reveal more information about each span, its duration, and any errors. For an interactive UI walkthrough, click [here](/product/sentry-basics/distributed-tracing/generate-first-error/#ui-walkthrough).
85
-
3. Open the [**Profiles**](https://sentry.io/orgredirect/organizations/:orgslug/profiling) page, select a transaction, and then a profile ID to view its flame graph. For more information, click [here](/product/explore/profiling/profile-details/).
<Expandabletitle="Need help locating the captured errors in your Sentry project?">
2
+
3
+
1. Open the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues) page and select an error from the issues list to view the full details and context of this error. For an interactive UI walkthrough, click [here](/product/sentry-basics/integrate-frontend/generate-first-error/#ui-walkthrough).
4
+
2. Open the [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/traces) page and select a trace to reveal more information about each span, its duration, and any errors. For an interactive UI walkthrough, click [here](/product/sentry-basics/distributed-tracing/generate-first-error/#ui-walkthrough).
5
+
3. Open the [**Profiles**](https://sentry.io/orgredirect/organizations/:orgslug/profiling) page, select a transaction, and then a profile ID to view its flame graph. For more information, click [here](/product/explore/profiling/profile-details/).
0 commit comments