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 Nuxt Modules page shows the readme as a documentation which can be
confusing as it does not contain all the details. This PR removes all
duplicated content that is also available in the docs and keeps the link
to the docs.
Nuxt Modules page: https://nuxt.com/modules/sentryCloses#19403
Check out the [Official Nuxt SDK Docs](https://docs.sentry.io/platforms/javascript/guides/nuxt/) for further information on configuration and usage.
19
19
20
20
## Compatibility
21
21
@@ -26,102 +26,6 @@ The minimum supported version of Nuxt is `3.7.0` (`3.14.0+` recommended).
26
26
This package is a wrapper around `@sentry/node` for the server and `@sentry/vue` for the client side, with added
27
27
functionality related to Nuxt.
28
28
29
-
## Manual Setup
30
-
31
-
### 1. Prerequisites & Installation
32
-
33
-
1. Install the Sentry Nuxt SDK:
34
-
35
-
```bash
36
-
# Using npm
37
-
npm install @sentry/nuxt
38
-
39
-
# Using yarn
40
-
yarn add @sentry/nuxt
41
-
```
42
-
43
-
### 2. Nuxt Module Setup
44
-
45
-
The Sentry Nuxt SDK is based on [Nuxt Modules](https://nuxt.com/docs/api/kit/modules).
46
-
47
-
1. Add `@sentry/nuxt/module` to the modules section of `nuxt.config.ts`:
48
-
49
-
```javascript
50
-
// nuxt.config.ts
51
-
exportdefaultdefineNuxtConfig({
52
-
modules: ['@sentry/nuxt/module'],
53
-
});
54
-
```
55
-
56
-
### 3. Client-side setup
57
-
58
-
Add a `sentry.client.config.ts` file to the root of your project:
59
-
60
-
```javascript
61
-
import { useRuntimeConfig } from'#imports';
62
-
import*asSentryfrom'@sentry/nuxt';
63
-
64
-
Sentry.init({
65
-
// If set up, you can use your runtime config here
66
-
dsn:useRuntimeConfig().public.sentry.dsn,
67
-
});
68
-
```
69
-
70
-
### 4. Server-side setup
71
-
72
-
Add a `sentry.server.config.ts` file to the root of your project:
73
-
74
-
```javascript
75
-
import*asSentryfrom'@sentry/nuxt';
76
-
77
-
// Only run `init` when process.env.SENTRY_DSN is available.
78
-
if (process.env.SENTRY_DSN) {
79
-
Sentry.init({
80
-
dsn:'your-dsn',
81
-
});
82
-
}
83
-
```
84
-
85
-
Using `useRuntimeConfig` does not work in the Sentry server config file due to technical reasons (the file has to be
86
-
loaded before Nuxt is loaded). To be able to use `process.env` you either have to add `--env-file=.env` to your node
87
-
command
88
-
89
-
```bash
90
-
node --env-file=.env .output/server/index.mjs
91
-
```
92
-
93
-
or use the `dotenv` package:
94
-
95
-
```javascript
96
-
importdotenvfrom'dotenv';
97
-
import*asSentryfrom'@sentry/nuxt';
98
-
99
-
dotenv.config();
100
-
101
-
Sentry.init({
102
-
dsn:process.env.SENTRY_DSN,
103
-
});
104
-
```
105
-
106
-
## Uploading Source Maps
107
-
108
-
To upload source maps, you have to enable client source maps in your `nuxt.config.ts`. Then, you add your project
109
-
settings to `sentry` in your `nuxt.config.ts`:
110
-
111
-
```javascript
112
-
// nuxt.config.ts
113
-
exportdefaultdefineNuxtConfig({
114
-
sourcemap: { client:'hidden' },
115
-
116
-
modules: ['@sentry/nuxt/module'],
117
-
sentry: {
118
-
org:'your-org-slug',
119
-
project:'your-project-slug',
120
-
authToken:process.env.SENTRY_AUTH_TOKEN,
121
-
},
122
-
});
123
-
```
124
-
125
29
## Troubleshoot
126
30
127
31
If you encounter any issues with error tracking or integrations, refer to the official [Sentry Nuxt SDK documentation](https://docs.sentry.io/platforms/javascript/guides/nuxt/). If the documentation does not provide the necessary information, consider opening an issue on GitHub.
0 commit comments