Friday 5 May 2017

Firebase API key is undefined when moved to environment variable

I am moving from localhost to a Heroku hosted application, and in order to commit my credentials.js file and keep API keys secret, I defined each value as a process.env variable in credentials.js before commiting to GitHub. Now I'm getting an error that states: Error: Your API key is invalid, please check you have copied it correctly.

I have confirmed that the correct API key was set as an environment variable, and to check, I added a console.log("firebaseApiKey " + credentials.firebaseApiKey) and it returns undefined.

This seems like an issue that could be common, but I haven't found a fix yet by Googling. Any insight is appreciated.



via Jake 1986

No comments:

Post a Comment