You don’t need to care about refresh token with client_credentials. Just fetch for a new token each time. Juste created one call that you use as DATA to fetch the token. Put this request in API Call after in Authorization header of each call.
You can create a plugins and you can use API definitions. But honestly, this is complex to do. Output an object for server-side/client-side