Skip to content

Get Next.js Build ID from Sentry #9195

Closed Answered by AbhiPrasad
vpmedia asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for writing in! The release is grabbed from the git SHA of the commit that represents the build. We try to infer this from environmental variables set.

See:

/**
* Returns a release dynamically from environment variables.
*/
export function getSentryRelease(fallback?: string): string | undefined {
// Always read first as Sentry takes this as precedence
if (process.env.SENTRY_RELEASE) {
return process.env.SENTRY_RELEASE;
}
// This supports the variable that sentry-webpack-plugin injects
if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vpmedia
Comment options

Answer selected by vpmedia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants