I have learned that private keys should be hidden in the backend b/c there isn't a way to hide them in the frontend. But what about public keys?
Do they need to be hidden in the backend?
Do they NEED to be in a .env file or is it just 'best practice' to do so?
Should a .env file ALWAYS be included in gitingore?
For reference, I'm building a website (deployed on Netlify) with a form that uses EmailJS and reCAPTCHA v2. Both have a private key that is held on the EmailJS server (🤷♀️) and a public key, which I currently have hard-coded (not sure if this is proper practice).
I would love to hear what others know and do. Thanks!