Skip to content

Commit

Permalink
feat: setup sentry
Browse files Browse the repository at this point in the history
Signed-off-by: Maud Royer <hello@maudroyer.fr>
  • Loading branch information
jillro committed Sep 6, 2024
1 parent c6a7c23 commit 4210dae
Show file tree
Hide file tree
Showing 9 changed files with 2,547 additions and 151 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.env.sentry-build-plugin
28 changes: 27 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { withSentryConfig } from "@sentry/nextjs";

/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
Expand All @@ -7,6 +9,30 @@ const nextConfig = {
});
return config;
},
experimental: {
instrumentationHook: true,
},
};

export default nextConfig;
/**
* The following environment variables are required in order for Sentry to work
* and for the source maps to be uploaded correctly:
* - SENTRY_DSN
* - SENTRY_URL
* - SENTRY_ORG
* - SENTRY_PROJECT
* - SENTRY_AUTH_TOKEN
*/
export default withSentryConfig(nextConfig, {
// Only print logs for uploading source maps in CI
silent: !process.env.CI,
widenClientFileUpload: true,
reactComponentAnnotation: {
enabled: true,
},
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
tunnelRoute: "/monitoring",
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
});
Loading

0 comments on commit 4210dae

Please sign in to comment.