Server Side vs Client Side Requests

I can see that the API can be consumed in two ways:

  • Frontend by placing the API publically and setting JavaScript Domains.
  • Backend with the API key hidden and setting IPs.

Generally speaking, is there a recommendation for which to opt for if it makes little to no difference for me and the application where the request is made?

Currently, I’m just doing it in the backend since I felt like making a FOSS Java wrap anyway, and prefer the idea of keeping the API key hidden if the requirements allow for it, plus might avoid users from making manual requests for other companies/officers via the browser dev tools using my API key.

The only things that I think goes for client side would be it’d finish the request a little faster since it’s made directly rather than being proxies through the backend, plus if the backend is down for whatever reasons it’d break on the frontend?

These two terms are used in the context of web and have many differences, including different purposes and programming languages. Client side and server side are terms that both indicate how and where code runs. Client side programming includes any coding or computation or effects or animation or any sort of interaction your website performs with the user via browser . But server side programming is that which performs all the task in the server only . So the user is unaware of that. Few years ago JavaScript compilers were available only on the client machine (browsers). So java script was called as a client side scripting language. On the client side JavaScript is run by v8 engine (Google chrome). But now in the server side also JavaScript is used. The v8 engine (with some modifications to provide the server functionality) is also used in the servers to run js codes. So, in both cases the language is the same, only the environment is different.