Environment configuration

Often you'll need additional configuration for your functions, such as
third-party API keys or tuneable settings. The Firebase SDK for Cloud Functions offers
built-in environment configuration to make it easy to store and retrieve this
type of data for your project.

Set environment configuration for your project

To store environment data, you can use the firebase functions:config:set
command in the Firebase CLI.
Each key can be namespaced using periods to group related
configuration together. Keep in mind that only lowercase characters are
accepted in keys; uppercase characters are not allowed.

For instance, to store the Client ID and API key for
"Some Service", you might run:

Access environment configuration in a function

Some configuration is automatically provided under the reserved firebase
namespace. Environment configuration is made available inside your running
function via functions.config().
To use the configuration above, your code might look like this:

Use environment configuration to initialize a module

Some Node modules are ready without any configuration. Other modules need extra
configuration to initialize correctly. We recommend you store this configuration
in environment configuration variables rather than hard-coding it. This helps
you keep your code much more portable, which lets you open source your
application or easily switch between production and staging versions.