DEV Community

Discussion on: Environment Variables in Next.js

 
akhilaariyachandra profile image
Akhila Ariyachandra • Edited

A workaround I found for now is to list all the variables you want in the client side code in the env property of the Next.js config.

env: {
    AUTH_SECRET: process.env.AUTH_SECRET,
}

I updated the post with more details. In the example I linked at the end of the post, I didn't use any secrets.