google-cloud-functionsfirebase-extensions

What is the priority order regarding firebase extension and an onRequest Cloud function?


I have a pre-configured Firebase Stripe extension that will handle the Stripe role responsible for allowing access to premium content. Additionally, I have my own webhook that will call an onRequest function to perform some data migration. The issue is, I want to catch the previous stripeRole before it is changed by the extension. Yet, I want to know if there is any order in which the stripeExtension and the Firebase onRequest cloud function are triggered by a webhook. Both the webhook and the cloud function will be triggered by the same event. is there is a priority for the extension over the on request ?


Solution

  • Firebase Extensions are just prebuilt Cloud Functions here. They take no precedence over other Cloud Functions that run in your project.

    If you want these actions to execute in a certain order, you will have to enforce that order in your application logic - for example: