Using HTTP Client instead of Fetch
Feature description
Add HTTP Client
Why would it be useful?
Fetch is good. But it's hard to handle HTTP errors. So, I recommend using an HTTP client like Axios or Ky.
Additional context
Add any other context about the problem here.
Great suggestion, Axios does allow eaiser interceptor globally. Are there some usecases you can think of that would benefit Infisical by switching over from fetch? Other than global error handling, I can't think of much. fyi @mv-turtle
We can reduce the amount of code. We use every fetch function with a new config. If we use an HTTP client instance, can set the config at once and re-use in every file.
This is probably a good idea! Axios is great!
Using a Server state management library e.g React-Query paired with Axios might also be beneficial. We can prefetch keys before the user is routed to the dashboard and perform Mutation when sending data to the database.
@LemmyMwaura this is a very cool idea! I think someone else proposed it in another issue
@mv-turtle Ooh Okay. if you decide to move in that direction. Let me know, I can help out.
Is this being worked on already? Would like to tackle this if it isn't?
Closing as its stale and we already migrated to this