You need to have your app follow the MVC software architecture and put the key in your controller. Your front end view that the user sees should never contain the business logic. It should always pass requests to your back end and allow the back end to do the work, and then send the information asynchronously back to the front end.
1 Like