0

Is there a way to deploy a firebase function other than firebase deploy --only functions?

I'm looking for a way to have a user build and deploy a pubsub function client-side.

Example

User adds a weather stations to their account. User selects time interval to ping weather station and record weather data and then deploys this function to run each time interval to catalog the weather data.

Currently, I have to make individual firebase functions for each user, but I'm wondering if there is a way that a user can generate and deploy a function on their own.

gsmith1515
  • 179
  • 9

1 Answers1

1

To deploy Cloud Functions one has to be a collaborator on the Firebase/GCP project, which is not a feasible solution when you want user-specific Cloud Functions.

A common approach here is to have one (typically callable) Cloud Function that your app calls when the user adds a weather station to their account. In that function you then set up a Cloud Functions trigger through Cloud Tasks, to run at the schedule for that weather station.

For more on this and other options, see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    Utilized the process of creating a function that gathers the stations --> puts them in a queue using cloud tasks --> and then uses another function to grab the weather data from an API and add the data firestore. I really appreciate the help! – gsmith1515 Jan 20 '22 at 03:08