learning-area
learning-area copied to clipboard
API keys included client side
The documentation on 3rd party API's shows how to hard code an API key into your client side javascript. It doesn't discuss how serving it client side can be a huge security risk or options to to address this (e.g. make the call server side). The code for the new york times api has the key included in the repo. https://github.com/mdn/learning-area/blob/main/javascript/apis/third-party-apis/nytimes/finished/script.js
The code is referenced/linked at https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Third_party_APIs#find_the_documentation