I am using nextjs v15 app router
Answered
Barbary Lion posted this in #help-forum
Barbary LionOP
While working with external apis, I want to use axios because of its features but also want to leverage fetch api features extended by nextjs as revalidateTag,revalidatePath, cache, request dedupe.
How to obtain this?
How to obtain this?
Answered by B33fb0n3
Axios is dead. Read about it here: https://www.adios-axios.com/
Use fetch instead.
--- Edit
Or like Near said use [ky](https://www.npmjs.com/package/ky/v/0.9.0) for a light-weight helper function
Use fetch instead.
--- Edit
Or like Near said use [ky](https://www.npmjs.com/package/ky/v/0.9.0) for a light-weight helper function
5 Replies
@Barbary Lion While working with external apis, I want to use axios because of its features but also want to leverage fetch api features extended by nextjs as revalidateTag,revalidatePath, cache, request dedupe.
How to obtain this?
Axios is dead. Read about it here: https://www.adios-axios.com/
Use fetch instead.
--- Edit
Or like Near said use [ky](https://www.npmjs.com/package/ky/v/0.9.0) for a light-weight helper function
Use fetch instead.
--- Edit
Or like Near said use [ky](https://www.npmjs.com/package/ky/v/0.9.0) for a light-weight helper function
Answer
Barbary LionOP
Then how we can leverage advantages like baseApi, interceptors
Asian black bear
By using
ky
or creating a light-weight helper function yourself.Barbary LionOP
