Firestore #
Google Cloud Storage #
Firebase Cloud Functions #
Environment variables #
# set environment variables
firebase functions:config:set someservice.key="THE API KEY" someservice.id="THE CLIENT ID"
# get all environment variables
firebase functions:config:get
To read these environment variables from a firebase cloud function, use:
const functions = require("firebase-functions");
functions.config().someservice.id;
To populate environment variables in your local environment (ex: when using ``):
firebase functions:config:get > .runtimeconfig.json
echo .runtimeconfig.json >> .gitignore
Sources:
- Environment configuration
- How do you setup local environment variables for Cloud Functions for Firebase - Stack Overflow
Error: Forbidden. Your client does not have permission to get URL /twitterSave from this server.
#
Try explicitly allowing unauthenticated invocation of a function by adding the allUsers
member id to the function with the Cloud Functions Invoker
role in Google Cloud Console with this guide from Google.
Sources:
Deploying #
Functions deploy had errors with the following functions
#
Try:
- checking the output of
firebase --debug deploy --only functions
- checking the output of
firebase functions:log
- deleting the
us.artifacts.[Project ID].appspot.com
bucket in the Cloud Storage page on Google Cloud Platform.
Sources: