google-cloud-functions

Firebase cloud functions bundled with webpack?

倾然丶 夕夏残阳落幕 提交于 2021-02-20 10:16:55
问题 I've been stuck for a while trying to make a webpack build for my cloud functions files. My project structure: ROOT - FUNCTIONS - DIS - bundle.js // THIS SHOULD BE GENERATED BY WEBPACK - SRC - myCloudFunction.js // SOURCE CODE FOR A CLOUD FUNCTION - entryPoint.js // ENTRY POINT FOR WEBPACK - index.js - package.json - SRC - App.js .babelrc firebase.json webpack.prod.js // THIS BUILDS FOR CLIENT (WORKING FINE) webpack.server.js // THIS SHOULD BUILD FOR THE SERVER (NOT WORKING) My goal is: Write

Firebase cloud functions bundled with webpack?

≡放荡痞女 提交于 2021-02-20 10:16:49
问题 I've been stuck for a while trying to make a webpack build for my cloud functions files. My project structure: ROOT - FUNCTIONS - DIS - bundle.js // THIS SHOULD BE GENERATED BY WEBPACK - SRC - myCloudFunction.js // SOURCE CODE FOR A CLOUD FUNCTION - entryPoint.js // ENTRY POINT FOR WEBPACK - index.js - package.json - SRC - App.js .babelrc firebase.json webpack.prod.js // THIS BUILDS FOR CLIENT (WORKING FINE) webpack.server.js // THIS SHOULD BUILD FOR THE SERVER (NOT WORKING) My goal is: Write

Cloud Functions for Firebase iterate through a child node

扶醉桌前 提交于 2021-02-20 09:09:29
问题 I just started to use firebase Functions and I am new to the node.js environment, can somebody tell how to iterate through a child node and get the child values. 回答1: see this example: const parentRef = admin.database().ref("path"); return parentRef.once('value').then(snapshot => { const updates = {}; snapshot.forEach(function(child) { updates[child.key] = null; }); return parentRef.update(updates); }); 回答2: Have you looked through the Cloud Functions for Firebase Samples? They contain many

Cloud Functions for Firebase iterate through a child node

别说谁变了你拦得住时间么 提交于 2021-02-20 09:06:08
问题 I just started to use firebase Functions and I am new to the node.js environment, can somebody tell how to iterate through a child node and get the child values. 回答1: see this example: const parentRef = admin.database().ref("path"); return parentRef.once('value').then(snapshot => { const updates = {}; snapshot.forEach(function(child) { updates[child.key] = null; }); return parentRef.update(updates); }); 回答2: Have you looked through the Cloud Functions for Firebase Samples? They contain many

Can Cloud Functions for Firebase be used across projects?

為{幸葍}努か 提交于 2021-02-20 06:16:23
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Can Cloud Functions for Firebase be used across projects?

血红的双手。 提交于 2021-02-20 06:14:34
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Can Cloud Functions for Firebase be used across projects?

萝らか妹 提交于 2021-02-20 06:14:29
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Firebase cloud functions/ hosting ssl pinning

混江龙づ霸主 提交于 2021-02-20 04:24:45
问题 My payment gateway requires ssl certificate pinning for their payment gateway endpoint on my side. Does Firebase support ssl pinning for cloud functions/hosting? I can't find this information in the official documentation or anywhere else on the net. Details published in the bank's technical requirements form: Response URL and Port Number Specify the Response URL and Port Number for us to send you payment notification. SSL Certificate: (To establish secure connection with your Response URL.)

Best Way to Use Business Logic Across Multiple Platforms (Cloud Functions?)

拥有回忆 提交于 2021-02-20 03:50:42
问题 I am in the process of creating a mobile and web version of an app using ReactJS and iOS respectively. Both of these platforms will pull data down from a Firestore database to use but I am wondering what is the best way to only write business logic once in order to do operations on the database? For instance, on both apps you will click a button that updates a field in the Firestore database, instead of writing the logic to do this in Javascript and then Swift, is there a best practice to

Using HttpsCallable with service credentials

你说的曾经没有我的故事 提交于 2021-02-20 02:58:46
问题 I'm using a bunch of HttpsCallable functions that are used by the client to safely invoke things on the backend. I now find myself in a situation where the backend (another cloud function) would need to trigger some of the same operations, so ideally I would just call the HttpsCallable from another cloud function. The callable library is not available in firebase-admin, and I'm assuming that's because it's doing user authentication. Would it be possible to somehow work around this? Maybe I