Environment Configuration with the Firebase CLI

Before file-based environment configuration support was released in firebase-functions v3.18.0, the recommended approach for environment configuration was via functions.config(). This made it possible to store, retrieve, and access data for each Firebase project.

Set environment configuration with the Firebase CLI

To set environment variables via the Firebase CLI, we must use the firebase functions:config:set command. This uses a key-value pair syntax similar to regular JavaScript objects, making it easy to group related configurations:

Get hands-on with 1200+ tech skills courses.