I have a React+NextJS project that I want to add an image-upload capabilities (to firebase storage) to.
In order to upload an image, I must initialize the uploader with my ApiKey. However, obviously I don't want my ApiKey to be exposed on the client.
I've googled it and saw that the recommendations are to keep it in an environment variable. But as I understand it, it protects only from the source control, but not from the actual exposure in the client browser (which is the one uploading the file to firebase).
My gut tells me it's code that should reside on the server, or maybe get a "one-time link" from the server and have the client app upload the image to it. But I can't help thinking that there must be a common (or at least best-practices) way of doing it?
I appreciate the help.
Yaron.