Vansh Dattwani
Vansh Dattwani

Reputation: 5

How To Add The Firebase Admin SDK Private Key (the .json file) in Python

I want to add the firebase admin sdk: so, I Clicked on the "GENERATE NEWPRIVATE KEY" button I got a .json file which was been downloaded automatically.

Then to add it I got a code-

cred = credentials.Certificate('path/to/serviceAccountKey.json')

Now,the question is, how should I add it to my code,which is in Python?

I tried copy pasting it,but it didn't work. It still gave errors.

And, I don't get why we have to just put in that code as we don't even specify the file that was being downloaded.

Upvotes: 0

Views: 879

Answers (1)

Luka Krajnc
Luka Krajnc

Reputation: 915

And, I don't get why we have to just put in that code as we don't even specify the file that was being downloaded.

cred = credentials.Certificate('path/to/serviceAccountKey.json')

Let's say that:

'path/to/serviceAccountKey.json'

is path to file-you-just-downloaded.json

Upvotes: 1

Related Questions