learning-area icon indicating copy to clipboard operation
learning-area copied to clipboard

API keys included client side

Open GuillaumeQuenneville opened this issue 2 years ago • 0 comments

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

GuillaumeQuenneville avatar Jun 08 '22 19:06 GuillaumeQuenneville