Is there a way to get the Firebase Function url from the Admin SDK for nodejs?
In prod it will look like: https://REGION-PROJECT.cloudfunctions.net/FUNCTION_NAME
And when serving locally: http://localhost:PORT/PROJECT/REGION/FUNCTION_NAME
Is it possible to get this value in nodejs programmatically? E.g. from admin or configuration settings?
The Firebase Admin SDK doesn't expose any APIs that deal with Cloud Functions. From what you've shared, it sounds like you have everything you need to build the URL yourself, which is the right way to go.
If you really must use another piece of software, you'll have to dive very deep into the inner workings of the Firebase CLI and figure out how to reuse its code. You'll probably have to look in two places - one for the emulator, and another for deployment. I suspect this is almost certainly not going to be worth your time, since building the strings yourself is pretty straightforward.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With