Skip to content

Commit

Permalink
feat: sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
leduyhien152 committed Mar 22, 2024
1 parent 9253aad commit 5564bc2
Show file tree
Hide file tree
Showing 8 changed files with 448 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.sentryclirc
1 change: 1 addition & 0 deletions envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export const AUTH_TELEGRAM_ID = process.env.NEXT_PUBLIC_AUTH_TELEGRAM_ID || "";
export const MOCHI_PROFILE_API = `${
process.env.NEXT_PUBLIC_MOCHI_PROFILE_API_HOST || "mochi-profile-api"
}/api/v1`;
export const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN || "";
39 changes: 38 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
import { withSentryConfig } from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
export default withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,
},
{
// 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)
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",

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

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@mochi-web3/login-widget": "^0.2.11",
"@radix-ui/react-slider": "^1.1.2",
"@semantic-release/git": "^10.0.1",
"@sentry/nextjs": "^7.107.0",
"clsx": "^2.1.0",
"next": "14.1.3",
"react": "^18",
Expand Down
Loading

0 comments on commit 5564bc2

Please sign in to comment.