Can anyone offer some advice on how to access environment variables locally using process.env and through Netlify using ${SOME_NETLIFY_VARIABLE} at the same time? Currently I have to manually edit the file between environments.
Thanks @hrishikesh , Iāll definitely look into that.
But is there a way to do it without using Netlify Dev? Iām imagining thereās some sort of logic saying something like āif local, use the auth token on my machine, else if using Netlify, use the env variableā
Well, in most Static Site Generators thereās a way to differentiate between development and production builds, but since this part is not being managed by a SSG, Iām not sure if conditional logic is possible here.
Contexts would be useful if the variables are different between production and development, if Iām not wrong. But, in this case, the variables have the same value, itās just a difference of how to access them in the code.