You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My manager asked me to define the tokens in the App Settings ( environment variables ), however I could not access them because the sentry.client.config is reserved for client component and the token should be start with NEXT_PUBLIC but because I'm using Docker, NEXT_PUBLIC environment can not changed during the runtime.
I would create NextJS action, access this key and assign it to the dsn key.
// This file configures the initialization of Sentry on the client.// The config you add here will be used whenever a users loads a page in their browser.// https://docs.sentry.io/platforms/javascript/guides/nextjs/import*asSentryfrom"@sentry/nextjs"import{getEnv}from"env"letvalconstfeedbackIntegration=Sentry.feedbackIntegration({// Additional SDK configuration goes in here, for example:colorScheme: "light",isNameRequired: true,isEmailRequired: true,nameLabel: "Ihr Name",emailPlaceholder: "Geben sie ihre E-Mail Adresse ein",isRequiredLabel: "(erforderlich)",namePlaceholder: "Gib deinen Namen ein",showBranding: false,formTitle: "Ein Problem melden",messageLabel: "Beschreibung",messagePlaceholder: "Was ist das Problem? Was haben Sie erwartet?",submitButtonLabel: "Problembericht senden",cancelButtonLabel: "Stornieren",buttonLabel: "Melde Probleme",successMessageText: "Vielen Dank für deinen Bericht!",})Sentry.init({dsn: getEnv(),// Adjust this value in production, or use tracesSampler for greater controltracesSampleRate: 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 productionreplaysSessionSampleRate: 0.1,// You can remove this option if you're not planning to use the Sentry Session Replay feature:integrations: [newSentry.Replay({// Additional Replay configuration goes in here, for example:maskAllText: true,blockAllMedia: true,}),feedbackIntegration,],})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone,
My manager asked me to define the tokens in the App Settings ( environment variables ), however I could not access them because the sentry.client.config is reserved for client component and the token should be start with
NEXT_PUBLIC
but because I'm using Docker,NEXT_PUBLIC
environment can not changed during the runtime.I would create NextJS action, access this key and assign it to the dsn key.
env.ts
(NextJS Action):sentry.config.client
Beta Was this translation helpful? Give feedback.
All reactions