Skip to main content

All Questions

Filter by
Sorted by
Tagged with
9 votes
1 answer
8k views

Is it secure to expose secret keys to a next.js app via environment variables?

As I take it, environment variables prefixed with NEXT_PUBLIC_ will be substituted by their respective values in the resulting bundle. Is it safe to supply things like API keys, OAuth secrets and the ...
D3PSI's user avatar
  • 324
4 votes
1 answer
3k views

Access Environment Variables from SASS in Next.JS

I am trying to add a variable to my scss files, referenced to .env variable. To achieve this, I've read a few tutorials, and I found this. I need to add this configuration to my next.config.js const ...
Rich's user avatar
  • 4,318
1 vote
2 answers
598 views

How do I setup environment variables for multiple environments?

I have a Next.js application and I have currently got this next.config.js setup to access my .env file when working locally, which works fine: // Initialize doteenv library require("dotenv").config();...
adam7918's user avatar