I want to upload my flutter projects to GitHub, without publicizing my API keys, I have already secured my firebase_options.dart file by removing it entirely and creating a “. env” file separately and using the flutter_dotenv dependency and manually input the firebase Options as my app is purely for android. My issue is that afterwards i found out that I might also have to secure the google-services.json & firebase.json files to hide my API key.
I already tried looking up ways to do this exact same thing, but I couldn’t find any answers to it. I haven’t learned any node.js or javascript or many other languages other than dart, python, java, C++ and C#, as such I would appreciate easy to understand answers preferably in a step-by-step fashion. I know it’s rather demanding of me but I’m rather afraid of losing my API Key due to all the horror stories I keep hearing about it.
Gaurav Paul is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Treat google-services.json
& firebase.json
like you would with a .env file.
Just like you wouldn’t want to upload your .env file, google-services.json
and firebase.json
should be manually copied over (or created with a build script) on deployment as well.
Read more (first reply): https://groups.google.com/g/firebase-talk/c/mMpMymNeoxk