I'd like to be able to create instances of this class instead of relying on a single globally shared instance. Axios has similar functionality and it's useful in scenarios where I have multiple APIs I want to interact with and they have different authentication. I can set default headers and such per-instance instead of trying to have my API calls explicitly specify the headers per-call or wrap the supafetch object myself to add these. This is also helpful where I want to keep the default instance pure, for instance as a public client where I never want to leak a credential.
I'd like to be able to create instances of this class instead of relying on a single globally shared instance. Axios has similar functionality and it's useful in scenarios where I have multiple APIs I want to interact with and they have different authentication. I can set default headers and such per-instance instead of trying to have my API calls explicitly specify the headers per-call or wrap the supafetch object myself to add these. This is also helpful where I want to keep the default instance pure, for instance as a public client where I never want to leak a credential.