supertokens/docs

Docs for devs who can't use axios or fetch for any reason

makeitcount opened this issue · 2 comments

In order to authenticate requests with the logged in session's access_token, there's is no other way than using axios or fetch.
The docs do not mention this other than vaguely signaling to use these methods.

Authentication didn't work when we follow the docs but use Angular's standard httpClient. Does XMLHttpRequest method works? It is not clear. So it will be helpful to know if something is not supported instead of guessing or writing the code and only then to get to know that it doens't work. If we're not supporting then , we should at least give following

  • Warning about the methods that are not supported (and what methods are supported with clearly mentioning they are the only supported methods)
  • Giving some context what actions do the default frontend SDK intercepters take (e.g. which headers they modify, how do they deal with various cases, etc.). So that the developer can follow the same thing for their choice of http client.

It might be useful to mention that fallback option that worked for me was to use FDI directly. I could make the code work with that but not without asking a lot of support questions, trial and errors.
I have more confidence on my code when I used FDI than using the interceptors which I don't know exactly what they are doing with each of the request. It is critical because auth is not the only thing that my code does. I want to make sure all other API requests keep working and some of them might have auth and some of them might not. Some of them I may want to retry and some of them I don't.

Since we are adding XHR interceptors, this change is no longer needed.