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 moreDoes firebase work on emulator?
The Firebase Local Emulator Suite consists of individual service emulators built to accurately mimic the behavior of Firebase services . This means you can connect your app directly to these emulators to perform integration testing or QA without touching production data.
Read more