Skip to content

Commit a8ca1c5

Browse files
authored
Merge pull request #37 from getsentry/sig/nuxt-example
feat(nuxt): Add nuxt example
2 parents 7530bad + 88eb211 commit a8ca1c5

File tree

6 files changed

+406
-36
lines changed

6 files changed

+406
-36
lines changed

apps/nuxt/app.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<header>
44
<nav>
55
<ul>
6-
<li><NuxtLink to="/test-param/1234">About</NuxtLink></li>
7-
<li><NuxtLink to="/catchAll/my-id-1337">Post 1</NuxtLink></li>
6+
<li><NuxtLink to="/test-param/1234">Test Param</NuxtLink></li>
7+
<li><NuxtLink to="/catchAll/my-id-1337">Catch All Route</NuxtLink></li>
88
<li><NuxtLink to="/404">404</NuxtLink></li>
99
<li><NuxtLink to="/?middleware">Faulty Router Middleware</NuxtLink></li>
1010
</ul>

apps/nuxt/nuxt.config.ts

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
import * as Sentry from '@sentry/nuxt';
2-
31
// https://nuxt.com/docs/api/configuration/nuxt-config
42
export default defineNuxtConfig({
53
devtools: { enabled: true },
6-
modules: ['@sentry/nuxt'],
7-
8-
runtimeConfig: {
9-
public: {
10-
sentry: {
11-
dsn: '' /* DSN */,
12-
debug: true,
13-
},
14-
},
15-
},
4+
modules: ['@sentry/nuxt/module'],
5+
debug: false,
166
});

apps/nuxt/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"dev": "nuxt dev",
88
"generate": "nuxt generate",
99
"preview": "nuxt preview",
10-
"postinstall": "nuxt prepare"
10+
"postinstall": "nuxt prepare",
11+
"clean": "npx nuxi cleanup"
1112
},
1213
"dependencies": {
1314
"@sentry/nuxt": "file:.yalc/@sentry/nuxt",

apps/nuxt/sentry.client.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/nuxt';
2+
3+
Sentry.init({
4+
dsn: 'your-dsn',
5+
debug: true,
6+
tracesSampleRate: 1,
7+
integrations: [Sentry.browserTracingIntegration()],
8+
});

apps/nuxt/sentry.server.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as Sentry from '@sentry/nuxt';
2+
3+
Sentry.init({
4+
dsn: process.env.SENTRY_DSN,
5+
tracesSampleRate: 1,
6+
debug: true,
7+
});

0 commit comments

Comments
 (0)