# add environment
firebase use --add
# Switching environments
firebase use default
firebase deploy -P staging # deploy to staging alias
https://firebase.googleblog.com/2016/07/deploy-to-multiple-environments-with.html
firebase experimental:functions:shell
//firebase > aggregateCustomers({})
https://firebase.googleblog.com/2017/09/testing-functions-locally-with-cloud.html
firebase deploy --only functions:makeUppercase
https://stackoverflow.com/a/44492787
let ref = db.collection("orders");
return new Promise((resolve, reject) => {
ref.add(order).then((order) => {
logger.info(order);
resolve(order);
}).catch((err) => {
logger.info(err);
reject(err);
})
})
firebase.auth().currentUser.getIdToken(/ forceRefresh / true)
.then(function(idToken) {
}).catch(function(error) {
});
https://stackoverflow.com/a/38233818
https://medium.com/@jwngr/implementing-firebase-auth-session-durations-82fa7b1fff08
# Deploy your .rules file
firebase deploy --only firestore:rules
https://firebase.google.com/docs/rules/manage-deploy
lazy var functions = Functions.functions(region: "europe-west1")