javascriptfirebasegoogle-cloud-functions

Firebase Cloud Functions: Difference between onRequest and onCall


Going through the docs, I encountered:

...you can call functions directly with an HTTP request or a call from the client.

~ source

there (link in the quote) is a mention about functions.https.onCall.

But in the tutorial here, another function functions.https.onRequest is used, so which one should I use and why? What is the difference/similarity between them?

Documentation for functions.https is here.


Solution

  • The official documentation for these concepts is quite helpful, but from the view of an amateur, the described differences were confusing at first.

    onCall

    onRequest

    Read more here Is the new Firebase Cloud Functions https.onCall trigger better?