Using Google Place Autocomplete API key on client side javascript for getting autocomplete suggestions for address autofill
I am developing a web application using HTML, CSS, Javascript as frontend and Django as backend python server. I have a form on the frontend side which consists of common address fields like street address, city, state, and zip. I want to implement google place autocomplete api so that the user can autofill the address fields by typing the address in the address field and getting the suggestions from google. Now the way I implemented is using the prebuilt widget that google provides and I placed it in my javascript file and it’s working as expected but now there’s a huge security concern regarding my api key being hardcoded in my javascript to fetch the suggestions. I know that it’s not a good practice to hardcode any type of secrets or api keys in any codebase, but I was unable to find any solution particularily in this situation.