Get code from firebase console which I deployed earlier
Solution 1
Note: the process below may work or not for your case. Don't rely on it as a replacement for keeping your code in a proper version control system.
You can retrieve the code for your Cloud Functions from the Cloud Console.
- Go to this URL
- Select the project that the function is in
- Select a function from the list
Select the Source at the top
- Click the "Source location" link
A zip file with the latest source of your function will start to download.
Note that these files may periodically get deleted. In that case, the above process will not work to recover your source code.
Solution 2
When you click to select your project, make sure you have the right organization selected.
Solution 3
In the firebase console in the left hand menu select Functions. Hover over the function you want to view and click the three vertical dots. Select Detailed Usage Stats. This will bring you to the Google Cloud console. Select 'Source' to get the source code.
Abhilasha
Updated on June 06, 2022Comments
-
Abhilasha about 2 years
I had created firebase functions in nodejs and deployed the code on firebase. The function was to send an email when the new user is created. I have lost the code now. Can we pull that code from firebase ?
-
Abhilasha about 7 yearsI am getting 404 after clicking on that link. On the page you added above inside code preview section I am getting this message : Archive not found in the storage location
-
Abhilasha about 7 yearsI had deployed it using firebase deploy command from my local machine
-
Frank van Puffelen about 7 yearsHmm... in that case the functions source might have been deleted from the Cloud servers too.
-
kodi over 6 yearsIf you are a collaborator on a project, it might not show up in the GCP dashboard. If you go to the Firebase dashboard, go to the functions directory, and go to one of the functions, off to the right there's a vertical ellipsis that only appears when you hover over it. Click that, and select "Detailed Usage Stats" - that will take you to the GCP dashboard for the project, and then you can follow these instructions.
-
Matt about 6 yearsWhere can I see
firebase-functions-source
file? -
deepelement over 5 yearsRule #1 for building a platform: Assume
git reset --hard
will happen waylessly -
MQLN over 5 yearsLifesaver for my own incompetence.
-
AFMeirelles over 4 yearsYou saved my day. Thanks.
-
C-lio Garcia about 3 yearsYou definitely saved my day... my project... my everything