There's more...
The best practice for API keys like this is to keep them as secret as possible. It's worth noting that any value that is loaded into Angular is discoverable via a careful inspection of the front-end application's source code. Most importantly, you should never commit any API keys into your project if it's uploaded to a public repository, such as GitHub. There are many automated bots and scanning tools that automatically look for and exploit accidentally published API keys in a variety of nefarious ways. It is a good practice to keep these keys secret so that they can't be easily abused and blocked for mis-use.
In this recipe, we stored our API key values in Angular application's environment configuration. This can be a convenient ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access