0
votes

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

1

1 Answers

0
votes

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!