Search code examples
firebasegoogle-cloud-functionsfirebase-tools

How do I emulate a Firebase extension?


I just installed a Firebase extension, and can see it in my Console. How do I get my local Functions emulator to use the extension as well?

When I start the emulators using the CLI, I can see that the functions emulator is 'Watching [locally defined path] for Cloud Functions...', but no evidence that the Firebase extension is downloaded or otherwise watched somehow.


Solution

  • July 2022: It is now possible to run extensions in the emulator. See the documentation on using the Extensions Emulator to evaluate extensions for full details.


    There's currently no built in support for running Extensions on Firebase's Emulator Suite yet.

    Luckily Firebase Extensions are mostly "just" predefined Cloud Functions with some installation and configuration data. And since Cloud Functions can be emulated, you can get the same functionality locally with some work.

    To run an extension on your local emulator, you will have to get the source of the extension (which is linked from the extension's page), and make the Cloud Functions (and possibly application) code connect to the emulators instead of the cloud-hosted services.

    Update: There is a workaround, which of the engineers working on Extensions documented here.