Making GraphQL api calls from server side code in custom Monday widget

# Context
Our dashboard widget needs a front-end (client-side) and needs to communicate to a back-end (server-side) that communicates with the Monday API.
In Monday you can deploy “client-side” code and “server-side” code.

# Question 1
In the “client-side” code it is easy to perform requests to the official Monday API using the “monday-sdk”. But we can’t seem to figure out how you can perform Monday API calls in the “server-side” code.

On the developer docs page “Choosing an authentication method” (https://developer.monday.com/apps/docs/choosing-auth) a “seamless” option and an “OAuth” option are suggested. But from what we understand, the “seamless” option wouldn’t be an option to use in the “server-side” code (unless it is somehow possible to provide the necessary details/tokens from the “client-side” to the “server-side” to be able to authenticate). The “OAuth” option seems to require user interaction (step 2) according to “The OAuth flow” (https://developer.monday.com/apps/docs/oauth#the-oauth-flow). And receiving a login page when a user is already logged in to Monday would be weird and confusing for the user.

So we are curious as to what the proper way would be to be able to perform Monday API requests (in name of a user) on the “server-side”. Or how it is possible to correctly use the “monday-sdk” on the “server-side” with the proper tokens provided.

# Question 2
When you want your client-side (frontend) to communicate with your server-side (backend) via an API, your client-side needs to know the URL of that API. But what is the proper way for the “client-side” to communicate with the “server-side” of the app, without a developer or admin having to update the URL of that “server-side” inside the “client-side” code?

Is a fullstack app, where the server-side serves the “client-side”/frontend, the solution? Or is there a better/easier solution?

5 replies