Step 1: Navigate to Functions Directory
Navigate to the "functions" folder from the root directory using the following command:
cd functions
Step 2: Verify the Firebase Project
Ensure you are in the correct Firebase project by listing the available projects:
firebase projects:list
If you need to switch to a different project, use the following command:
firebase use project-id
Step 3: Create a RuntimeConfig Variable
Set up a RuntimeConfig variable in VScode Terminal. Use the command below, replacing your-variable-name and your-value:
firebase functions:config:set your-variable-name.key=your-value
For example, to set up the Brevo API key:
firebase functions:config:set brevo.brevo_api=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
Follow this naming convention:
use underscores, avoid uppercase characters, and omit quotes.
Step 4: Create a .runtimeconfig.json File
Generate a .runtimeconfig.json file containing your Firebase project's configuration variables. Use this Firebase CLI command: