How to call a custom api to cart in development store?

Hi, I want to call a custom API (backend) to the cart along with the actual API on clicking “Add to cart” i.e., “cart/add.js” in the development store. So, What are the best practices for it? I assume, by directly calling the custom API along with the actual one in product-form.js in the theme edit code (or) creating the extension with the react app, if, yes then how can I access the “Add to Cart” button and call two APIs simultaneously? (or) Is there any other way to do it?