A socket.io plugin for Vue.js 2 that provides WebSocket integration via $socket on Vue instances and a socket option in components. Version 0.2.7 is the latest stable release with infrequent updates. It requires socket.io-client as a peer dependency and works by registering the plugin with Vue.use. Differentiates from newer libraries by targeting Vue 2 with Vue 3 support as a planned future version (2.x line only).
npm install vue-websocket-nextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers the plugin with Vue 2 and socket.io-client, then uses $socket to emit and socket events to listen.
Install vue-websocket-next instead of vue-websocket, and update imports accordingly.
For Vue 3, consider using vue-socketio-extended or native socket.io-client with Composition API.
Always pass the IO import as the second argument: Vue.use(VueWebsocket, IO);
Use socket.prefix or socket.namespace in the component socket option to adjust event names.
Pass reconnection: true (or other options) as the fourth argument to Vue.use.
Ensure Vue.use(VueWebsocket, IO) is called before creating the Vue instance. Check that socket.io-client is correctly imported.
Install socket.io-client (npm install socket.io-client) and import it: import IO from 'socket.io-client'; then pass IO to Vue.use.
Check the server URL and ensure socket.io server is running. Add error handler in socket.events to log more details.
This plugin only works with Vue 2. Ensure you are using vue@2.x. For Vue 3, use a different plugin.