At process. env, on firebase functions projects, there is a boolean variable called FUNCTIONS_EMULATOR, which indicates if the process is running on an emulator or on server . this is enough to determine if environment is dev or production.
Read moreHow does firebase emulator work?
The Firebase Local Emulator Suite allows you to test your code with our core products in an interoperable way. The Cloud Functions emulator supports HTTP functions, callable functions, and background functions triggered by Cloud Firestore, Realtime Database, Cloud Storage, Authentication, and Pub/Sub .
Read more