Firestore Run Functions Locally with Admin

by siefix   Last Updated May 16, 2019 00:26 AM

I'm trying to run my Cloud Functions locally using the below guide

https://firebase.google.com/docs/functions/local-emulator

I'd like to be able to use the Admin SDK in my local functions. I've downloaded JSON admin keys at the Service Accounts Pane of the Google Cloud Console and it says to add it using

export GOOGLE_APPLICATION_CREDENTIALS="path/to/key.json"

I generated keys using

NOT

What I tried

I tried to save it down to a separate folder, and I provided the path as relative to root. And I executed this command in terminal while in my functions folder. It didn't give me any response. Just went to the next line in Terminal.

export GOOGLE_APPLICATION_CREDENTIALS="/Users/[user]/Documents/[PROJECT]/Service_Account/file_name.json"

Questions:

  • Did I download/use the right JSON credentials?
  • Is there a certain place I need to save that .json file? Or can it be anywhere n my system?
  • Does that path need to be from root? Or relative to my functions folder?
  • Where do I need to execute this command?
  • Should it provide some sort of response that it worked? How do we know if it does?


Related Questions


Updated March 17, 2019 15:26 PM

Updated June 11, 2019 20:26 PM

Updated August 31, 2018 11:26 AM

Updated March 25, 2018 19:26 PM

Updated July 11, 2019 03:26 AM