T
tRPC

❓-help

In the context should I put all my dependencies for my endpoint handlers?

IAAI am a Dev10/1/2023
For example I have the end point 'getStuff` In this endpoint the handler call 3 party apis and map the data to the tRPC output. But I have an API key rotator class, to do each request to a 3 party API with the different API key in each request. So should I put in the context the API key rotator class? And this should be a singleton like the db instance? Also the API key rotator has dependency on the db, to store the last used API key, and consult all API keys. Thanks

Looking for more? Join the community!