Firebase: How to trigger HTTPs onRequest function within a Realtime Database onCreate function?

十年热恋 提交于 2019-12-06 15:59:30

Calling one Cloud Function from another Cloud Functions is almost never a good idea. For one thing, you'll be paying for two invocations, where the work could be done in just one. There are better ways to re-use the code.

For example, you could include the code for the payment in the Realtime Database triggered Cloud Function?.

Or you could extract the business functionality of that Cloud Function, and put that in a regular JavaScript function, so that you an call if from the Realtime Database triggered function.


A database trigger comes from the Realtime Database to Cloud Functions. No client-side application code is involved, so it also can't be redirected.

If you want to send a response back to the client when the operation has completed, you typically write the response for the client back into the database in a place that the client watches. For example, you could write the response to: /users/{userId}/order_results/{orderId} and the client can then wait for a value at this location.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!