I have developed a web application which makes use of Google sign-in within an AngularJS application.
Since the client_id and api_key are written in the Javascript I think it's quite easy to find them out even just with browser's dev console.
Apparently it's possible to "obscure" JS code (e.g. How can I obfuscate (protect) JavaScript? ), but my concern is: does this really make impossible to a potential attacker to access the keys?
If not, what's the best practice in this case? I've heard of some kind of backend to obscure the keys written in the JS. kind of "gateway"
Just to mention, my concerns is not just about Google APIs but all the code I write which I would like to not be "open source" unless I decide to do so
EDIT: since I'm not sure my doubt was completley clear, here is my actual question
what methodology I can use to effectively prevent users "stealing" my keys? there exist any service which serves as gateway? shall I design one on my own?