diff --git a/examples/with-sentry/README.md b/examples/with-sentry/README.md index 759c61273b80b133b16bad1b4d389f8ec9a83f04..f38bd64b1e3cba7e8b697c5fa99ee3763ae8a968 100644 --- a/examples/with-sentry/README.md +++ b/examples/with-sentry/README.md @@ -63,7 +63,7 @@ You will need to install and configure the [Sentry Vercel integration](https://d 1. Set up the `NEXT_PUBLIC_SENTRY_DSN` environment variable as described above. 2. Save your Sentry organization slug as the `SENTRY_ORG` environment variable and your project slug as the `SENTRY_PROJECT` environment variable in `.env.local`. -3. Save your git provider's commit SHA as either `VERCEL_GITHUB_COMMIT_SHA`, `VERCEL_GITLAB_COMMIT_SHA`, or `VERCEL_BITBUCKET_COMMIT_SHA` environment variable in `.env.local`. +3. Save your git provider's commit SHA as `VERCEL_GIT_COMMIT_SHA` environment variable in `.env.local`. 4. Create an auth token in Sentry. The recommended way to do this is by creating a new internal integration for your organization. To do so, go into **Settings > Developer Settings > New internal integration**. After the integration is created, copy the Token. 5. Save the token inside the `SENTRY_AUTH_TOKEN` environment variable in `.env.local`. 6. Set `NEXT_PUBLIC_SENTRY_SERVER_ROOT_DIR` to the absolute path of the folder the Next.js app is running from diff --git a/examples/with-sentry/next.config.js b/examples/with-sentry/next.config.js index 96d8cd909a0a1a4f29105880015b4f214ce97e49..f23bbaa2226706759e05b724d3aab07ebc1e64ad 100644 --- a/examples/with-sentry/next.config.js +++ b/examples/with-sentry/next.config.js @@ -6,16 +6,9 @@ const { SENTRY_PROJECT, SENTRY_AUTH_TOKEN, NODE_ENV, - VERCEL_GITHUB_COMMIT_SHA, - VERCEL_GITLAB_COMMIT_SHA, - VERCEL_BITBUCKET_COMMIT_SHA, + VERCEL_GIT_COMMIT_SHA, } = process.env -const COMMIT_SHA = - VERCEL_GITHUB_COMMIT_SHA || - VERCEL_GITLAB_COMMIT_SHA || - VERCEL_BITBUCKET_COMMIT_SHA - process.env.SENTRY_DSN = SENTRY_DSN const basePath = '' @@ -25,7 +18,7 @@ module.exports = { // Make the COMMIT_SHA available to the client so that Sentry events can be // marked for the release they belong to. It may be undefined if running // outside of Vercel - NEXT_PUBLIC_COMMIT_SHA: COMMIT_SHA, + NEXT_PUBLIC_COMMIT_SHA: VERCEL_GIT_COMMIT_SHA, }, webpack: (config, options) => { // In `pages/_app.js`, Sentry is imported from @sentry/browser. While @@ -66,7 +59,7 @@ module.exports = { SENTRY_ORG && SENTRY_PROJECT && SENTRY_AUTH_TOKEN && - COMMIT_SHA && + VERCEL_GIT_COMMIT_SHA && NODE_ENV === 'production' ) { config.plugins.push( @@ -75,7 +68,7 @@ module.exports = { ignore: ['node_modules'], stripPrefix: ['webpack://_N_E/'], urlPrefix: `~${basePath}/_next`, - release: COMMIT_SHA, + release: VERCEL_GIT_COMMIT_SHA, }) ) }