Skip to content

Commit

Permalink
Merge pull request #42 from bastiendmt/sentry
Browse files Browse the repository at this point in the history
Add sentry
  • Loading branch information
bastiendmt authored Aug 12, 2023
2 parents 8da4f84 + 1f55440 commit e4fc7f6
Show file tree
Hide file tree
Showing 7 changed files with 439 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ yarn-error.log*
next-env.d.ts

.env

# Sentry Auth Token
.sentryclirc
33 changes: 32 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { withSentryConfig } = require('@sentry/nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
Expand All @@ -15,4 +17,33 @@ const nextConfig = {
},
};

module.exports = nextConfig;
const sentryWebpackPluginOptions = {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,

org: 'bastiendmt',
project: 'actordle',
};

module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions, {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/monitoring',

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"@radix-ui/react-scroll-area": "^1.0.4",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-toast": "^1.1.4",
"@sentry/nextjs": "^7.63.0",
"@sentry/react": "^7.63.0",
"@types/node": "20.4.4",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
Expand Down
30 changes: 30 additions & 0 deletions sentry.client.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "https://e15f8d4dd6297d14753ee66928aac07d@o4505693103521792.ingest.sentry.io/4505693123641344",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,

replaysOnErrorSampleRate: 1.0,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
// Additional Replay configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
16 changes: 16 additions & 0 deletions sentry.edge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
// The config you add here will be used whenever one of the edge features is loaded.
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "https://e15f8d4dd6297d14753ee66928aac07d@o4505693103521792.ingest.sentry.io/4505693123641344",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
});
15 changes: 15 additions & 0 deletions sentry.server.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "https://e15f8d4dd6297d14753ee66928aac07d@o4505693103521792.ingest.sentry.io/4505693123641344",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
});
Loading

1 comment on commit e4fc7f6

@vercel
Copy link

@vercel vercel bot commented on e4fc7f6 Aug 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

actordle – ./

actordle-bastiendmt.vercel.app
actordle-git-main-bastiendmt.vercel.app
actordle.vercel.app

Please sign in to comment.