Setup

Check the Nuxt.js documentation for more information about installing and using modules in Nuxt.js.

Installation

Add nuxt-apollo-auth and @nuxtjs/apollo dependencies to your project:

 npm install nuxt-apollo-auth @nuxtjs/apollo

Then, add nuxt-apollo-auth and @nuxtjs/apollo to the modules section of nuxt.config.js:

nuxt.config.js
{
 modules: [
   '@nuxtjs/apollo',
   'nuxt-apollo-auth'
 ],
 qAuth: {
   // Options
 }
}

Using with TypeScript

Add nuxt-apollo-auth to the compilerOptions.types section of your project's tsconfig.json file:

tsconfig.json
 {
  compilerOptions: {
    "types": [
      "nuxt-apollo-auth",
      // "@nuxtjs/apollo",
      // "vue-apollo/types"
    ]
  },
}