/pikobar-functions

Cloud functions.

Primary LanguageJavaScriptMIT LicenseMIT

pikobar-functions

Firebase Cloud Function for Pikobar's Firebase project.

Getting Started

https://firebase.google.com/docs/functions/get-started

Running Functions Locally

https://firebase.google.com/docs/functions/local-emulator

Updating Environment Variables

For example, we want to add a key-value pair named myVar:myValue.

  1. Edit env.json, add the key-value pair
{
   ..., //other key-value pairs
   "myVar": "myValue"
}
  1. Unset existing env variables
firebase functions:config:unset env
  1. Set the new env variables
firebase functions:config:set env="$(cat env.json)"
  1. Use the env variables
const value = functions.config().env.myVar; //value contains 'myValue'

We can use nested variables. See updateStatistics variable in env.json for example.