Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Multi Programming Language Suppport

I have a quick question, is it possible to have multiple programming languages for the Firebase Server in Cloud Functions?

like image 965
Andrey Avatar asked Aug 30 '25 17:08

Andrey


2 Answers

Each function must choose a single runtime for execution. You can provide any code that runs on that runtime. That code can originate from any number of languages. For example, if you target a nodejs runtime, you could provide JavaScript code that comes from a combination of JavaScript, TypeScript, and even Kotlin, all transpiled to JavaScript. The runtime doesn't care - it's going to just execute the JavaScript.

You can't combine incompatible languages. For example, you can't combine Swift and JavaScript, unless you somehow find a way to transpile the Swift to JavaScript.

Each function can have a different runtime. There is no requirement that all of your functions target the same runtime. However, if you're using the Firebase CLI for deployment, you can only target a nodejs runtime. If you want other runtimes, you'll have to use Google Cloud Platform tools (gcloud) to deploy the function.

like image 152
Doug Stevenson Avatar answered Sep 02 '25 15:09

Doug Stevenson


Google Cloud Functions supports Node, Python, Go and Java these days. For a full list, see the documentation on the Cloud Functions Execution Environment. Many other languages can be used, as they can be transpiled to one of the above.

When deploying your Cloud Functions through Firebase, the only supported languages are JavaScript and TypeScript on Node.js though.

like image 26
Frank van Puffelen Avatar answered Sep 02 '25 16:09

Frank van Puffelen