Questions tagged [google-cloud-functions]

Google Cloud Functions is a lightweight, event-based, asynchronous compute solution that allows you to create small, single-purpose functions written in Node.js, Python or Go that respond to cloud events without the need to manage a server or a runtime environment.

Google Cloud Functions is a lightweight, event-based, asynchronous compute solution that allows you to create small, single-purpose functions written in or that respond to cloud events without the need to manage a server or a runtime environment.

Related tags:

12970 questions
186
votes
16 answers

How do I structure Cloud Functions for Firebase to deploy multiple functions from multiple files?

I would like to create multiple Cloud Functions for Firebase and deploy them all at the same time from one project. I would also like to separate each function into a separate file. Currently I can create multiple functions if I put them both in…
182
votes
27 answers

Enabling CORS in Cloud Functions for Firebase

I'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is that I can't access the function I wrote through an AJAX request. I get the "No 'Access-Control-Allow-Origin'" error. Here's an example of the function…
171
votes
8 answers

How to protect firebase Cloud Function HTTP endpoint to allow only Firebase authenticated users?

With the new firebase cloud function I've decided to move some of my HTTP endpoint to firebase. Everything works great... But i have the following issue. I have two endpoints build by HTTP Triggers (Cloud Functions) An API endpoint to create users…
156
votes
23 answers

Get Download URL from file uploaded with Cloud Functions for Firebase

After uploading a file in Firebase Storage with Functions for Firebase, I'd like to get the download url of the file. I have this : ... return bucket .upload(fromFilePath, {destination: toFilePath}) .then((err, file) => { // Get…
Valentin
  • 4,251
  • 5
  • 30
  • 43
152
votes
6 answers

Firebase cloud functions is very slow

We're working on an application that uses the new firebase cloud functions. What currently is happening is that a transaction is put in the queue node. And then the function removes that node and puts it in the correct node. This has been…
126
votes
3 answers

How to deploy some functions to Cloud Functions for Firebase without affecting some other functions?

When I run firebase deploy --only functions it reads the index.js file and updates all functions exported from that file. If on the previous deploy there was a function named a, and in the current deploy there is no such function, a will be deleted.…
Randy Sugianto 'Yuku'
  • 64,635
  • 54
  • 168
  • 216
121
votes
2 answers

HTTP Error: 401 while setting up firebase cloud functions for android project

I`m trying to set up firebase functions, but I get an error after running firebase init. Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.…
M.Ali
  • 5,775
  • 4
  • 18
  • 36
110
votes
3 answers

Cloud Functions for Firebase trigger on time?

I am looking for a way to schedule Cloud Functions for Firebase or in other words trigger them on a specific time.
109
votes
3 answers

How can I solve the error 'TS2532: Object is possibly 'undefined'?

I'm trying to rebuild a web app example that uses Firebase Cloud Functions and Firestore. When deploying a function I get the following error: src/index.ts:45:18 - error TS2532: Object is possibly 'undefined'. 45 const data =…
96
votes
4 answers

What is the difference between Cloud Functions and Firebase Functions?

Cloud Functions and Firebase Functions (or "Cloud Functions for Firebase") both look the same. Please describe the use case of each. Both use HTTP functions. In the Cloud Functions: exports.helloHttp = function helloHttp (req, res) { …
90
votes
1 answer

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…
Qwerty
  • 19,992
  • 16
  • 88
  • 107
90
votes
6 answers

Cloud Functions for Firebase - Billing account not configured

I just implemented the new Cloud Functions for Firebase, but there something in the log that bothers me: Billing account not configured. External network is not accessible and quotas are severily limited. Configure billing account to remove…
Hristo Stoyanov
  • 1,823
  • 1
  • 10
  • 23
79
votes
3 answers

When to choose App Engine over Cloud Functions?

Sorry, if this is a naive question, but i've watched bunch of talks from google's staff and still don't understand why on earth i would use AE instead of CF? If i understood it correctly, the whole concept of both of these services is to build…
73
votes
5 answers

How do you setup local environment variables for Cloud Functions for Firebase

I'm using http cloud functions to listen for a request and then return a simple message. I'm developing cloud functions locally using: firebase serve --only functions I've setup some custom environment variables using firebase…
ChrisMacSEA
  • 751
  • 1
  • 5
  • 5
69
votes
8 answers

How do I get the server timestamp in Cloud Functions for Firebase?

I know you can pull the server timestamp in web, ios, and android - but what about the new Cloud Functions for Firebase? I can't figure out how to get the server timestamp there? Use case is me wanting to timestamp an email when it arrives. On web…
1
2 3
99 100