0

I have a function which is deployed in Google Cloud Platform with Serverless using the serverless-google-cloudfunctions plugin. The function was deployed successfully but when I tried to access the require('firebase-functions').config() object it was undefined.

Isn't the Firebase config available if you deployed the function with gcloud? Does the deployment have to be done with firebase-cli?

My assumption was that since Firebase functions are also gcloud functions and vice-versa that I wouldn't have any problems accessing the config.

I haven't tried to deploy the function with gcloud sdk (without Serverless).

Thanks

Bettina
  • 93
  • 1
  • 8

1 Answers1

-1

Yes, first, you need to create your database on Firebase directly on the Firebase Console. After that, you can connect your project to Firebase and use it from within the Google Cloud Platform.

If you need more information about Firebase projects, you can access the documentation Understand Firebase projects.

After that, I would recommend you to take a look at the documentation Get started: write and deploy your first functions, to check more about using Firebase with Cloud Functions used by GCP.

Let me know if the information helped you!

gso_gabriel
  • 4,199
  • 1
  • 10
  • 22
  • Thanks for your answer. It's not the first time I'm deploying functions in firebase. I had no problem accessing the firebase config when I deployed them with firebase-cli. In this particular case though, I deployed the function with serverless and it seems that I don't have access to firebase configuration. I was wondering if anyone else had the same issue. – Bettina Feb 11 '20 at 10:00
  • Hi @Bettina considering that, I would recommend you to reach out directly to the [Firebase Support](https://firebase.google.com/support). They should be able to confirm if this is expected or not. :) – gso_gabriel Feb 11 '20 at 12:55