-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Any env variables prefixed with |
Beta Was this translation helpful? Give feedback.
Any env variables prefixed with
NEXT_PUBLIC_
should be available in yoursentry.client.config.ts
file.