Connecting API Data: Authentication

The two videos on connecting API data were very helpful, but did not go into authentication concerns.

In my example, I want to store the API base URL and authentication credentials in Builder. Is the best way to do this with a data model?

Authentication needs to run to get a token, which is to be passed with each request, in the http header. What is the best place to locate the call to get an auth header? Also, the token expires after 15 mins non usage, so, there needs to be a mechanism to refresh or retrieve a new token.

I want for all of this to happen in the server side, to protect the auth credentials as well as the token.

Any advice is appreciated!

Hi @rjakes You can give it a try using our Builder.io HTML API - Builder.io

Feel free to reach out if this doesn’t help!

@garima , thank you for your reply!
I’m not yet following how this helps. I’m talking about connecting to an external, third party, API. Please let me know if I’m missing something obvious.