Description
I was doing some digging trying to find a way to differentiate function logic depending on whether the cloud function is running in the emulator or not. Apparently, we can tell through process.env.FUNCTIONS_EMULATOR
. The problem is, I can't find this anywhere in the documentation. It's not stated in the Firebase Environmental Configuration docs, or the Gcloud environmental variables docs(though the latter doesn't surprise me). It's been a feature for a while tho, but it seems to me that the only way someone could know about it is by stumbling on #1364 or by trusting internet comments talking about a variable that's not even in the docs.
This leads me to wonder whether this is just unique to FUNCTIONS_EMULATOR
, or there are a lot more firebase-specific .env variables out there that aren't in the docs.