|
Hi, We define our environment and our DSN variables in Azure environments or App Settings: Then we access them from import * as Sentry from "@sentry/nextjs"
Sentry.init({
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
replaysOnErrorSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// In development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
})and in our NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_SENTRY_ENVIRONMENT=
However, as we know Next.js bundle these variables during the build process and inject them, I expect that they will not be accessible if we define them in Azure Environment from Sentry client configuration file because the initial value was empty, and we have to define them in the environment files. |
Answered by
lforst
Aug 26, 2024
Replies: 1 comment 1 reply
|
Any env variables prefixed with |
1 reply
Answer selected by
alamenai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Any env variables prefixed with
NEXT_PUBLIC_should be available in yoursentry.client.config.tsfile.