Ive built an APi that receives the name of a person and returns some information about that person.
I want to make it easy for third parties to use my API in their website, so I decided to create a JS widget that can be added as a script tag.
The widget is essentially a modal that accepts form data and has a submit button to POST the data to my API.
My problem is, how can I make a third parties backend server receive the response of the API. My understanding is that if called from client side JS, the response will be delivered to the users browser session rather than the third parties backend server.
Do i need to make my API do a post call to the third party server? (i would need to make a configuration for every third party who uses my API then) or can i write javascript in my widget that will do this post to their server? Or is my novice understanding of JS completely wrong here?