How to handle Oauth2

I have a component that displays tabular data. This data comes from an API that requires Oauth2 to make calls to the endpoint.

What is the recommended (or best practice) way for retrieving data that requires an active token (refresh token etc)? The data queries menu is generic HTTP only. Is the expectation to put all this logic in every instance that requires Oauth2? (See pseudo code below)

This also would require maintaining state of the current token and have the initial token retrieval expose sensitive tokens right in plasmic studios builder.

1 Like

Hey @anthony_schanen.

Plasmic currently does not have a native integration with oauth2. The recommend approach here would be to use Code components Using code components in Plasmic Studio | Learn Plasmic to manage the more complex logic.

1 Like