REMINDER
How do I store a file with GOOGLE_APPLICATION_CREDENTIALS needed for Firebase Auth?
-
Hey. Would anyone know how I could upload and use GOOGLE_APPLICATION_CREDENTIALS json file as an Environment variable?
As described here: https://firebase.google.com/docs/admin/setup#node.js_1
e.g.
GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json" -
Hey Ugnius,
in the env variable settings, add a new env var, name it "googleJSON" for eg. but you can name it as you want
on the right side, as value, paste the whole text content of the json file you have from google.var googleJSON = JSON.parse(process.env.googleJSON);
admin.initializeApp({
credential: admin.credential.cert({
projectId: googleJSON.project_id,
clientEmail: googleJSON.client_email,
privateKey: googleJSON.private_key
}),
databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
});Just a small thing, whenever you can you should avoid Google!
Google deprecates API and services every week and providing nearly zero warning to "customers", in fact they have no respect at all for developers using their services and it's nearly impossible to talk with someone there. So if you want your service to be down in the next 6 months because it's deprecated without any notice ... sure go with google