Failed to deploy my Firebase Api FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing

Viewed 965

Happy new year !

I got a problem with my node API with firebase I tried to deploy on plesk and got this message :

{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}

I tried absolutly all the documentation way and got still the same message.

I also tried with node 8 / 10 / 12 and nothing change..

Do I need to use my own .env ? I also tried to put all the json credential from google in but still same error...

Or should I hardcode the keys like that ?

admin.initializeApp({
credential: admin.credential.cert({
"type": process.env.FIREBASE_TYPE,
"project_id": process.env.FIREBASE_PROJECT_ID,
"private_key_id": process.env.FIREBASE_PRIVATE_KEY_ID,
"private_key": process.env.FIREBASE_PRIVATE_KEY,
"client_email": process.env.FIREBASE_CLIENT_EMAIL,
"client_id": process.env.FIREBASE_CLIENT_ID,
"auth_uri": process.env.FIREBASE_AUTH_URI,
"token_uri": process.env.FIREBASE_TOKEN_URI,
"auth_provider_x509_cert_url": process.env.FIREBASE_AUTH_PROVIDER_X509_CERT_URL,
"client_x509_cert_url": process.env.FIREBASE_CLIENT_X509_CERT_URL
}),
databaseURL: "https://my-firebase-app.firebaseio.com"
});

Any idea ?

0 Answers
Related