Environment variables in NextJS

There are 2 types of variables you can store.
  • Client Side - process.env.NEXT_PUBLIC_variableName - This is how you access the variables on client side. Note the prefix NEXT_PUBLIC_
  • Server Side - process.env.variableName - This is how you access server side variables in NextJS


Complex problems, Simple Solutions