Skip to content

Commit 9a4f595

Browse files
feat: sentry (nodejs#6099)
Co-authored-by: Brian Muenzenmeyer <[email protected]>
1 parent 20cc909 commit 9a4f595

File tree

8 files changed

+525
-79
lines changed

8 files changed

+525
-79
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ cache
3030

3131
# TypeScript
3232
tsconfig.tsbuildinfo
33+
34+
# Sentry Config File
35+
.sentryclirc

next.config.mjs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
import { withSentryConfig } from '@sentry/nextjs';
34
import withNextIntl from 'next-intl/plugin';
45

56
import { BASE_PATH, ENABLE_STATIC_EXPORT } from './next.constants.mjs';
@@ -67,4 +68,22 @@ const nextConfig = {
6768
},
6869
};
6970

70-
export default withNextIntl()(nextConfig);
71+
// Next.js Config with i18n Configuration
72+
const withIntlConfig = withNextIntl()(nextConfig);
73+
74+
// Next.js Config with Sentry configuration
75+
export default withSentryConfig(
76+
withIntlConfig,
77+
{ silent: true, org: 'nodejs-org', project: 'nodejs-org' },
78+
{
79+
// upload Next.js or third-party code in addition to our code
80+
widenClientFileUpload: true,
81+
// transpile the Sentry code too since we target older browsers in our .browserslistrc
82+
transpileClientSDK: true,
83+
// attempt to circumvent ad blockers
84+
tunnelRoute: '/monitoring',
85+
// prevent source map comments in built files
86+
hideSourceMaps: false,
87+
disableLogger: true,
88+
}
89+
);

next.constants.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,9 @@ export const DEFAULT_VIEWPORT = {
184184
width: 'device-width',
185185
initialScale: 1,
186186
};
187+
188+
/**
189+
* This is the Sentry DSN for the Node.js Website Project
190+
*/
191+
export const SENTRY_DSN =
192+
'https://02884d0745aecaadf5f780278fe5fe70@o4506191161786368.ingest.sentry.io/4506191307735040';

0 commit comments

Comments
 (0)