Hey, with React, we are using Axios for our API ca...
# support-questions
h
Hey, with React, we are using Axios for our API calls to our backend. We were using before the ST Axios interceptor but I see it's deprecated now. Based on your doc, I see that the tokens are automatically added to every fetch/xrh calls to our backend but this is not very customisable. We have a few axios calls where we don't have to have ST security on it & auto refresh calls, how can we disable ST for an axios instance ?
r
Hey @HHChift
You can override the addXhrInterceptor recipe function on the frontend’s session.init and just do nothing in the body. This will disable auto adding interceptors to axios
You can then continue to use the addAxiosInterceptor to the axios instances that you want
h
And we can use the addAxiosInterceptor even if its deprecated ?
r
Yes.
h
Can you point me out to the documentation of addXhrInterceptor ?
Which recipe and how to override ? it seems not part of your documentation
r
You want to use the override config in session.init on the frontend, and provide the
addXMLHttpRequestInterceptor
function to it from the recipe interface (https://supertokens.com/docs/auth-react/modules/recipe_session.html#RecipeInterface)