@nuxtjs/axios is a Nuxt 2 module that integrates Axios HTTP client seamlessly into Nuxt applications. Current stable version is 0.28.1, with a maintenance-only release cadence. It automatically sets base URLs for client and server, exposes $axios instance with setToken helper, enables withCredentials for same-origin requests, proxies SSR headers, integrates with Nuxt progress bar and proxy module, and supports auto-retries via axios-retry. Key differentiator: designed specifically for Nuxt 2, not compatible with Nuxt 3. Ships TypeScript types. Recommended for Nuxt 2 projects needing secure HTTP calls.
npm install huume-nuxt-axiosNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to install and configure @nuxtjs/axios in a Nuxt 2 project, then use the $axios instance in asyncData to fetch data.
Use @nuxtjs/axios for Nuxt 2, or use nuxt3 with h3/http or native fetch.
Consider migrating to Nuxt 3's built-in $fetch or another HTTP client if needed.
Use a cookie or localStorage to persist tokens and call setToken on app initialization.
Configure proxy module to forward headers explicitly if needed.
Use $axios.get if you need status codes, headers, etc.
Run: npm install @nuxtjs/axios, then add 'modules: ["@nuxtjs/axios"]' in nuxt.config.js
Ensure @nuxtjs/axios is in modules array and you're accessing $axios from Nuxt context (e.g., asyncData, this).
Call setToken inside a plugin or middleware after module initialization: this.$axios.setToken(token, 'Bearer')
Set baseURL in nuxt.config axios option or via environment variable.