Search code examples
firebasegofirebase-admin

Project ID Required to Access Firestore Error


I wish to use the firebase admin-sdk but for some reason, I am getting a "project id is required to access Firestore error".

I have downloaded an admin-sdk json file from the firebase console and I have placed it in the same directory as the file that calls it.

opt := option.WithCredentialsFile("../<FILENAME>.json")

The credentials file has the project id but for some reason the opt variable is unable to extract data from the credentials file, and as a result when I try to get the firestore client this error is occuring.

Thanks!


Solution

  • Problem solved, I was using the wrong absolute path.