How to implement Oauth2 without User consent (only for backend use)

How to implement Oauth2 without User consent (only for backend use)

Hi, how are you?

I'm trying to implement zoho subscriptions api to my server (node js) to read / write new products, plans, etc.

But in my flow, i don't need any user consent... and i have some questions about the implementation.

1) I created a self client appication in zoho developers console, so i could generate a ten minutes valid "code" to exchange for a new token. And when i have a one hour token i need to implement some logic to refresh this token every 1 hour (because the access token is invalidated).

how i can implement this logic?

I need to save the first access token (obtained by manually generated code) in my server code? and then, every time that i want to make a request to zoho subscriptions validate if the token is expired to make a new access token with the refresh token?

do you have any examples of that (maybe in other languages).

thanks for your help!