I'm developing a small web-app to help users manage shopping lists.
One of the required features is the ability of the application to notify the user if a shop of the same category is near him/her.
To do so I'm using Foursquare API.

  • Said API needs a KEY and CLIENT_ID to make the request.
  • Requests are made by the client via some javascript.

Should I have the KEY and CLIENT_ID in the client-side javascript or should the script use my web-app as a proxy for requests?

If the former is the better approach how can I safely save the KEY and CLIENT_ID in the client-side script?


You cannot safely store the secrets in clientside Javascript. Hence you need to go with option 2: proxy via the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.