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.

0
votes
0answers
15 views

Error “First argument must be a valid event type” when accessing Firebase database from Cloud functions

I am trying to access list stored at the root of the database as shown: In my cloud function: const root = admin.database().ref(); root.once('value').then((snapshot) => { var arr = JSON.parse(...
0
votes
0answers
10 views

How to use firebase functions with NestJS 6?

How to create firebase function with NestJS? In old versions code below worked but how to remake it for NestJS 6 with adapters? import * as functions from 'firebase-functions'; import * as express ...
0
votes
1answer
14 views

Calculate time difference within cloud functions

In my Cloud Firestore database, always a user is registered, the database stores the time the event occurs: const p = usersReference.add({ ..., registerTime: admin.firestore.FieldValue....
0
votes
1answer
21 views

Firebase/Firestore find documents that have a field in a given array

I have a firebase collection whose documents have a field phone_number. I want to query firebase for all the documents that have the field phone_number in a array given by me! Is it possible to do ...
0
votes
1answer
10 views

getting random econnrefused in my webservices

I created some webservices following all the google cloud functions docs consuming a second generation MySQL DB. Everything run smoothly but I'm getting random "Econnrefused" errors: { Error: connect ...
0
votes
2answers
26 views

send form data to firebase functions

I want to send data from my javascript web page to firebase cloud function (HTTP Request). I have seen a few tutorials on using Busboy, but that is at the cloud function side. What I want to know is ...
1
vote
0answers
34 views

data() method does not exist in QueryDocumentSnapshot in cloud functions

I am simply trying to get a document's data in one of my firebase callable functions, I already know its ID from a previous query. The problem is that the resulting object from the [...].doc(id).get()...
0
votes
0answers
26 views

request blocked by CORS policy even after setting headers

I wrote a cloud function that takes the request and performs processing on the request. It works as expected when it is from same API domain. But in case of cross API request, I am getting the below ...
-1
votes
1answer
17 views

Unexpected token mailTransport firebase cloud function

'use strict'; // The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers. const functions = require('firebase-functions'); // The Firebase Admin SDK to access the Firebase ...
0
votes
1answer
19 views

How to connect to Cloud-SQL from Cloud Function in Go?

For a project i'm trying to connection a cloud function to a cloud sql database setup as described in this quickstart guide. The function is configured in the same region, the service account has the ...
0
votes
2answers
28 views

Pub/Sub vs Http in Cloud Functions Cron Jobs

I want to make Cron Jobs by using Cloud Functions and Google Scheduler I know roughly what Publish / Subscribe is, I searched it. But I still don`t get it perfectly even I read it and over again. ...
4
votes
1answer
43 views

Route from node-js app engine to google cloud functions - integration of cloud functions with App Engine

I have a NodeJS web application running in Google App Engine. Also I've mapped my custom domain to it, say example.com. I've few business functions (microservices) written in node.js and deployed as ...
0
votes
0answers
13 views

Firebase Functions receive Forbidden & Requires Domain Ownership when creating Storage Buckets

I have a Firebase Function that runs from an onCreate Firestore DB trigger. The function then needs to create a directory (and eventual temp file within the bucket), however whenever I try to create ...
0
votes
1answer
22 views

Firebase Cloud Functions send notification weird output

I'm create a function like this to send Notification to new user. exports.sendCreateSuccessNotification = functions.firestore .document("users/{userId}") .onCreate((snap, context) => { ...
0
votes
0answers
44 views

Problem with chaining promises in Firebase Functions

Hello i have this function: exports.SentEmailWithTemplate1 = functions.firestore.document('request/{requestId}').onCreate((snap, contex) => { var logsRef = firestore.collection('logs').doc(); ...
1
vote
0answers
13 views

Use Telegram Database Library (TDLib) in GCP Functions or AWS Lambda with JavaScript

The main project is to have a Telegram Application that would read the groups/supergroups I am signed up for and forward all new posts to the group that I own. I need to implement it in serverless ...
0
votes
1answer
25 views

How to retrieve the parent of a sub-collection item in a firebase trigger event

I'm trying to write a firebase realtime database trigger that monitors when a new chat message has been created, I then want to navigate up the record tree to the parent record to retrieve information ...
0
votes
0answers
18 views

POST Request to fetch stripe credentials with Cloud Function in Node.js

I'm currently using Cloud Functions as my backend for a mobile app. I've got basic payments working with Stripe with cloud functions programmed with node.js. I've been following the documentation here:...
1
vote
0answers
40 views

page.goto freezes on cloud functions for some websites

I am using: Puppeteer version: 1.13.0 Platform / OS version: Google Cloud Node.js version: 8 await.page.goto("https://somewebsite.com") freezes when I deploy it on Google Cloud functions. I receive ...
0
votes
0answers
19 views

How to test and debug a bot request that triggers a cloud function

The Problem I'm building a angular pwa and I wanted to do some basic seo optimizing on it. I set up the meta tags to change when you navigate to different routes in the application by using a seo ...
1
vote
1answer
19 views

How to resume Google Cloud Speech API (longRunningRecognize) timeout on Cloud Functions

I'm trying to create an application to transcribe some wav files using cloud functions and cloud speech API. The official document shows how to do this ( https://cloud.google.com/speech-to-text/docs/...
0
votes
1answer
20 views

Accessing Value from Key via Change (onWrite)

I am trying to access the value of a key(node) from the firebase realtime database. I am using the onWrite trigger which passes the change paramters, which holds snapshot of the database before the ...
1
vote
1answer
45 views

response.send is not a function

I am writing a firebase function for the webhook fulfillment of dialogflow chatbot. It keeps generating error that response.send is not a function const functions = require('firebase-functions'); var ...
0
votes
0answers
29 views

toLocaleString not working on firebase cloudFunctions

My node 8 function, hosted at Firebase Cloud Functions isn't working as expected. I've a toLocaleString call passing all parameters to format in Brazilian currency format, but I getting the default EN ...
1
vote
0answers
26 views

Send email via SendGrid & FireBase [duplicate]

i set my cloud functions to send an email to everyone who create a user in my DB, but even tho a lot of checking and changes things wouldn't work my function: exports.ConfirmationEmaill = functions....
0
votes
1answer
29 views

Firebase Cloud Function(Cron Jobs) in Android is it able?

I don't understand well the document of Cloud Function provided on the firebase website so I had been watching cloud function Cron Jobs from "Firecast" on YouTube channel "Firebase" (I don`t know why ...
0
votes
0answers
41 views

Firabase Functions deploy had errors

I'm trying to deploy my app to firebase but every time give me this issue but I don't know what is it need !? this is my code in app.js //construct const functions = require("firebase-functions")...
1
vote
0answers
19 views

Get number of documents in a big collection in Cloud Firestore

I know this question was already asked but I'm being specific about my case: I've got a large database (approximately 1 million documents inside the collection users). I wanna get the exact number of ...
0
votes
1answer
26 views

Updating Algolia Index Records On Firestore Update

I'm trying to use cloud firestore triggers to automatically update records in our Algolia "users" index. Here's our cloud function: exports.updateUser = functions.firestore .document('users/{id}')....
0
votes
1answer
15 views

Return Axios data from a Firebase module

This is in my index.js: const dt = require('./src/dash-token'); exports.getToken = functions.https.onRequest((req, res) => { res.send("res : "+dt.getDashToken()) ; }); This is in my dash-...
0
votes
0answers
14 views

Cloud Function CORS setup [duplicate]

I have tried to add CORS filtering in firebase cloud functions, however, my app could still make requests even though I`m not setting up any headers in my request. Is there something wrong in my ...
1
vote
1answer
14 views

Google Cloud Functions - Python - HTTP Trigger URL Without Function Name

I have a Google Cloud Function triggered via HTTP. The trigger URL is in the format: https://europe-west1-PROJECT-NAME.cloudfunctions.net/FUNCTION-NAME This works fine, however I need to beable to ...
1
vote
1answer
27 views

Store image in Firebase Storage from within a Firebase Database function

I'm building an app in Firebase and I'm trying to insert an image in Firebase Storage from within a Real-time Database function. The function is triggered when a record is inserted in the DB. The ...
0
votes
0answers
14 views

How to get Firebase Function request size?

What is the best way to read size of a request object sent to Firebase Callable Function? I would like to take actions based on the size of request sent from a client but the only options I see are: ...
3
votes
1answer
29 views

Cloud functions returns null, when called directly from the app

I am trying to use Firebase cloud functions from my app to post emails and names of users into cloud firestore collection with randomly generated IDs. Everything works well, but I want to get a ...
1
vote
1answer
32 views

Express in Google Cloud Functions

Watching some tutorials on firebase cloud functions it seems like express is pretty much the standard tool. I was wondering though if it would make any sense to pull up a separate express app for each ...
0
votes
0answers
21 views

Error sending mail with Firebase, Nodemailer and Zoho [duplicate]

I am trying to send a mail using Firebase Functions from an onCreate trigger using nodemailer and Zoho mail account. This is the entire function export const mailFunc = functions.database.ref('/data/{...
0
votes
1answer
39 views

Sync data between Google Firestore and Google Sheets using Cloud Functions/Admin SDK

While using Cloud Firestore as data backend, I need to share some data collections with non-tech site managers (editors, sales teams, etc.). Also, I wish to give these people access to edit the data ...
2
votes
0answers
41 views

Cloud functions timeout on page.goto()

I run tests with puppeteer in cloud functions. If I run test on local machine all is fine. If I run tests in cloud functions emulator it's fine as well. But when I deploy my function to the cloud all ...
0
votes
1answer
22 views

Firebase Realtime Cloud Function - Cannot read property of null snapshot

I've gone through all similar answers with no luck, but for some reason, my Firebase cloud function is returning a snapshot.val() of null. The first console.log is printing correctly giving the ...
0
votes
0answers
11 views

Access database value in firebase function

Hello I am trying to access my firebase realtime database inside a function like so exports.sendNotification = functions.database.ref('/requests/{id}/{formatted_address}').onCreate(event => { ...
0
votes
2answers
21 views

Undefined type in Cloud Functions Realtime Database trigger

I'm trying to develop a Cloud Function that takes the value of an amount, then takes the total and add's the amount onto that total before re-writing the total with the new amount. so far this is ...
2
votes
0answers
28 views

Firebase function triggered twice

I need to create a Firebase user which has 3 related dataset saved in the Realtime Database arranged like below. root | x - dataset1 | x - dataset2 | x - whatever | | | x - ...
0
votes
0answers
24 views

How to use admin.auth().createUser() with hashed password on Cloud Functions?

I'm building a web app using Angular for the frontend and Cloud Functions for backend stuff. Also using Firebase Authentication to register and login users. To persist data I'm using Cloud Firestore. ...
0
votes
1answer
43 views

Add additional data to user profile via firestore functions onCreate

I'm trying to automatically create a user data in my firestore db when user sign up through firestore functions. However I got 2 option for sign up. Bussiness account and personal account. If user ...
1
vote
1answer
25 views

How can I disable http access to a GCP Cloud function

A GCP cloud function that takes a HTTP trigger can be accessed via http and https transports. Is there a way to disable the http endpoint?
0
votes
2answers
45 views

Firebase Cloud Function Serving Local File for Download

I created cloud function that generates an xlsx file, I need the user to download that file after it's generated. Method 1: Upload to Bucket, then redirect So far i've tried uploading the file to a ...
0
votes
0answers
16 views

Send a file using ssh2 sftp in Cloud Functions

I want to send a file using SFTP in cloud functions. The file will be named as today's date with ascii extension and was stored in Google Cloud Storage. So in order to use files in cloud functions, I ...
0
votes
1answer
12 views

Value of firebase functions onwrite sometimes is null

I'm trying to implement an Android ordering system and I'm using Realtime Database. To send notifications I'm using Firebase Functions in JavaScript. Each user is stored in the database along with ...
0
votes
1answer
10 views

Reading and writing in firestore only through cloud functions

I want to set my Cloud Firestore database permissions so that no one will be able to read and write from it except through Cloud Functions. How can I do this? My guess (according with Firestore docs)...

http://mssss.yulina-kosm.ru