Closed johannesdz closed 3 years ago
Hi @johannesdz Do you need an http adapter to detect status? Or an interceptor? Thanks!
Hi @thiagosaife , as an interceptor.
Hey @johannesdz, understood. Thanks!
@thiagosaife made a nice feature to add an interceptor for logging: https://github.com/storyblok/storyblok-js-client/pull/76/files
but you could also overwrite the axios client by overwriting the client variable.
let clientInstance = new StoryblokClient({ accessToken: ..., cache: ... })
clientInstance.client = axios.create({...})
Hi @thiagosaife , yes, currently we are using it as you proposed. But then we always depent on you axios version in our whole frontend application - this is definitely something we want to avoid. It shouldn't be too crazy, since axios is already providing such a adaptor functionality.
Hi @johannesdz We are updating the client to receive a function as a response interceptor. Hope it fits your needs. As soon as we updated it, I'll let you know. Best!
Hi @johannesdz . You can get the latest version now. Look for the responseInterceptor on https://github.com/storyblok/storyblok-js-client/blob/master/README.md
it would be very helpful, if instead of using default axios, we could pass our own axios adapter (axios functionality), where we take care of logging and other custom stuff. I know you can pass some settings, but especially logging on server side is our biggest need.
It could work like this:
client: new StoryblokClient({ accessToken: ..., cache: ..., axiosAdapter: ..., }),