On recent projects I did, main reason for moving it to backend was security. If you put it into client side that usually means you also need to give api keys of the 3rd party service to the client and that means acess to 3rd party service publicaly. If api key permissions cannot be configured to match your needs then it's not an option at all