Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
NextJS change env variable dynamically

I'm working on a CMS where users can create their website...

We are running the admin panel on ReactJS and the created website on NextJS on 2 different projects.

I want to give my users to change the theme of their website from the admin panel. and then set an environment variable on the frontend (NextJS) to apply the theme of their website

Something like:

# .env

WEBSITE_THEME = "summer"

and I will have to call the variable on my _app.tsx

function MyApp({ Component, pageProps }: AppProps) {
  return(
   <ThemeProvider theme={process.env.WEBSITE_THEME}>
     <Component {...pageProps} />
   </ThemeProvier>
  )
}

I would like to know if I could change the env variable on my NextJS project when the user changes theme on the admin panel (ReactJS project)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!