How to hide API Keys

I am a bit confused by this project, because Codecademy tells you to hide your API Keys and not publish them anywhere multiple times although they’ve published their own keys right here. How do I even hide my API Keys? Isn’t Javascript run in the browser in this case and therefore public?

Hi, welcome to the community.

Yes, generally speaking you would not disclose your API keys. In this case, however, you’re learning how to build the various components and link them all together - you’re not building an app for public consumption.

In production, it would most likely be your back-end which handled retrieving the data from the API and passing it to the front-end (the Wanderlust app).

1 Like

Got it, thanks for taking the time to explain it for me!