Skip to content

Commit ac42063

Browse files
authored
docs(nuxt): Remove duplicated setup instructions (#19422)
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/sentry Closes #19403
1 parent 91d7244 commit ac42063

File tree

1 file changed

+2
-98
lines changed

1 file changed

+2
-98
lines changed

packages/nuxt/README.md

Lines changed: 2 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
This SDK is for [Nuxt](https://nuxt.com/). If you're using [Vue](https://vuejs.org/) see our
1414
[Vue SDK here](https://github.com/getsentry/sentry-javascript/tree/develop/packages/vue).
1515

16-
## Links
16+
## Setup Instructions and Documentation
1717

18-
- [Official Nuxt SDK Docs](https://docs.sentry.io/platforms/javascript/guides/nuxt/)
18+
Check out the [Official Nuxt SDK Docs](https://docs.sentry.io/platforms/javascript/guides/nuxt/) for further information on configuration and usage.
1919

2020
## Compatibility
2121

@@ -26,102 +26,6 @@ The minimum supported version of Nuxt is `3.7.0` (`3.14.0+` recommended).
2626
This package is a wrapper around `@sentry/node` for the server and `@sentry/vue` for the client side, with added
2727
functionality related to Nuxt.
2828

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-
export default defineNuxtConfig({
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 * as Sentry from '@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 * as Sentry from '@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-
import dotenv from 'dotenv';
97-
import * as Sentry from '@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-
export default defineNuxtConfig({
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-
12529
## Troubleshoot
12630

12731
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

Comments
 (0)