Gathering detailed insights and metrics for vue-socket.io
Gathering detailed insights and metrics for vue-socket.io
Gathering detailed insights and metrics for vue-socket.io
Gathering detailed insights and metrics for vue-socket.io
npm install vue-socket.io
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3,937 Stars
114 Commits
495 Forks
67 Watchers
1 Branches
27 Contributors
Updated on Jul 03, 2025
Latest Version
3.0.10
Package Id
vue-socket.io@3.0.10
Size
68.84 kB
NPM Version
6.14.7
Node Version
12.18.2
Published on
Jul 31, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Vue-Socket.io is a socket.io integration for Vuejs, easy to use, supporting Vuex and component level socket consumer managements
are you looking for old documentation? it's here
1npm install vue-socket.io --save
1import Vue from 'vue' 2import store from './store' 3import App from './App.vue' 4import VueSocketIO from 'vue-socket.io' 5 6Vue.use(new VueSocketIO({ 7 debug: true, 8 connection: 'http://metinseylan.com:1992', 9 vuex: { 10 store, 11 actionPrefix: 'SOCKET_', 12 mutationPrefix: 'SOCKET_' 13 }, 14 options: { path: "/my-app/" } //Optional options 15})) 16 17new Vue({ 18 router, 19 store, 20 render: h => h(App) 21}).$mount('#app')
1import Vue from 'vue' 2import store from './store' 3import App from './App.vue' 4import VueSocketIO from 'vue-socket.io' 5 6const options = { path: '/my-app/' }; //Options object to pass into SocketIO 7 8Vue.use(new VueSocketIO({ 9 debug: true, 10 connection: SocketIO('http://metinseylan.com:1992', options), //options object is Optional 11 vuex: { 12 store, 13 actionPrefix: "SOCKET_", 14 mutationPrefix: "SOCKET_" 15 } 16 }) 17); 18 19new Vue({ 20 router, 21 store, 22 render: h => h(App) 23}).$mount('#app')
Parameters | Type's | Default | Required | Description |
---|---|---|---|---|
debug | Boolean | false | Optional | Enable logging for debug |
connection | String/Socket.io-client | null | Required | Websocket server url or socket.io-client instance |
vuex.store | Vuex | null | Optional | Vuex store instance |
vuex.actionPrefix | String | null | Optional | Prefix for emitting server side vuex actions |
vuex.mutationPrefix | String | null | Optional | Prefix for emitting server side vuex mutations |
If you want to listen socket events from component side, you need to add `sockets` object in Vue component, and every function will start to listen events, depends on object key
1new Vue({ 2 sockets: { 3 connect: function () { 4 console.log('socket connected') 5 }, 6 customEmit: function (data) { 7 console.log('this method was fired by the socket server. eg: io.emit("customEmit", data)') 8 } 9 }, 10 methods: { 11 clickButton: function (data) { 12 // $socket is socket.io-client instance 13 this.$socket.emit('emit_method', data) 14 } 15 } 16})
If you need consuming events dynamically in runtime, you can use `subscribe` and `unsubscribe` methods in Vue component
1this.sockets.subscribe('EVENT_NAME', (data) => { 2 this.msg = data.message; 3}); 4 5this.sockets.unsubscribe('EVENT_NAME');
When you set store parameter in installation, `Vue-Socket.io` will start sending events to Vuex store. If you set both prefix for vuex, you can use `actions` and `mutations` at the same time. But, best way to use is just `actions`
1import Vue from 'vue' 2import Vuex from 'vuex' 3 4Vue.use(Vuex) 5 6export default new Vuex.Store({ 7 state: {}, 8 mutations: { 9 "<MUTATION_PREFIX><EVENT_NAME>"() { 10 // do something 11 } 12 }, 13 actions: { 14 "<ACTION_PREFIX><EVENT_NAME>"() { 15 // do something 16 } 17 } 18})
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 17/30 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More