Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Added necessary configuration files to run Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Oct 15, 2023
1 parent f2f487d commit a91f8b1
Show file tree
Hide file tree
Showing 9 changed files with 949 additions and 63 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ NEXT_PUBLIC_BANNER=https://opengraph.githubassets.com/master/FlorianLeChat/Domeg
NEXT_PUBLIC_TWITTER=@FlorianTrayon
NEXT_PUBLIC_DESCRIPTION=Domego is a serious educational game in which each player takes the role of an actor in a construction operation.

# Sentry parameters
SENTRY_DSN=https://url.to.sentry.io/1234567890
SENTRY_ORG=org
SENTRY_PROJECT=project
SENTRY_AUTH_TOKEN=sntrys_token

# Google Analytics and reCAPTCHA keys
NEXT_PUBLIC_RECAPTCHA_ENABLED=false
NEXT_PUBLIC_RECAPTCHA_PUBLIC_KEY=6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ next-env.d.ts
# playwright
/test-results/
/playwright-report/
/playwright/.cache/
/playwright/.cache/

# Sentry Config File
.sentryclirc
31 changes: 21 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
/**
* @type {import("next").NextConfig}
*/
const { i18n } = require("./next-i18next.config");
const basePath = new URL(process.env.NEXT_PUBLIC_URL ?? "").pathname;
const { i18n } = require( "./next-i18next.config" );
const { withSentryConfig } = require( "@sentry/nextjs" );

module.exports = {
const basePath = new URL( process.env.NEXT_PUBLIC_URL ?? "" ).pathname;
const nextConfig = {
i18n,
basePath:
basePath === "/"
? ""
: basePath.endsWith("/")
? basePath.slice(0, -1)
: basePath,
poweredByHeader: false,
};
basePath: basePath === "/" ? "" : basePath.endsWith("/") ? basePath.slice(0, -1) : basePath,
sentry: {
tunnelRoute: "/monitoring",
disableLogger: true,
hideSourceMaps: true,
widenClientFileUpload: true
}
};

const sentryConfig = {
org: process.env.SENTRY_ORG,
silent: true,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN
};

module.exports = withSentryConfig( nextConfig, sentryConfig );
Loading

0 comments on commit a91f8b1

Please sign in to comment.