Architecturally I don't believe there is a best practice with Cloud Functions specifically. Your idea of injecting the endpoint makes it flexible for any future APIs you have, and would follow the SOLID design principles.
You could send an object with all necessary data and only have one function, using a library like request. Then all you have to do is structure your input parameters to match.
Architecturally I don't believe there is a best practice with Cloud Functions specifically. Your idea of injecting the endpoint makes it flexible for any future APIs you have, and would follow the SOLID design principles.
You could send an object with all necessary data and only have one function, using a library like request. Then all you have to do is structure your input parameters to match.
Something like this: