Installation

Add nuxt-socket-io dependency to your project:

yarn add nuxt-socket-io
npm install nuxt-socket-io

Then, add nuxt-socket-io to the modules section of nuxt.config.js:

nuxt.config.js
{
  modules: [
    'nuxt-socket-io'
  ],
  io: {
    // Options
  }
}

Finally, since the module requires Vuex to operate correctly, please at the minimum make sure you have a Vuex state defined:

store/index.js
export const state = () => ({})

The module needs this so it can register its own Vuex module