Sree Grandhe
Sree Grandhe

Reputation: 419

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!

Upvotes: 2

Views: 3547

Answers (1)

Sree Grandhe
Sree Grandhe

Reputation: 419

Problem solved, I was using the wrong absolute path.

Upvotes: 8

Related Questions