Doppler won't inject secrets inside my Next.js project

I am having a problem with Next.js topic and inject secrets from doppler into them. Everything is properly installed inside my project and all the commands work fine but for whatever reason, whenever I try inject my credentials into my project, it just won’t do it. i can print them on my terminal but they just won’t inject into my project. I have tried everything. Can someone help me please? Yes, i am using process.env.*

@Ryan_Henry There are some idiosyncrasies with how environment variables work with Next.js. Notably, the process.env that’s accessible in those projects isn’t the same one you typically find elsewhere. They manage it separately and have their own rules around what variables are accessible there (primarily to avoid leaking secrets in frontend applications). You can find more about this here:

Next.js does include support for .env files, so the easiest thing to do here might be to adjust how you run your app to use doppler run --mount (see our docs on this). Up until recently, this wouldn’t work with Next.js, but more recent versions should work fine using this method now. Essentially, you “mount” your secrets as a .env file (it’s actually a named pipe, so secrets aren’t stored on disk) and then Next.js will load them using its built-in dotenv handling. Give this a shot and see if it works better for you!