secrets from env file defined in Next config defined leaking in client.
I am using Nextjs 13.4.3, I have defined variables in next config coming from env file like:
the issue is it is getting leaked in the client, what can be solution?
1 Reply
You don't need to add your env variables in next config
this adds them to the client bundle
just have the .env file and prefix your client variables with NEXT_PUBLIC
env in next config is mostly for backwards comparability