{"id":13506703,"url":"https://github.com/richardeschloss/nuxt-socket-io","last_synced_at":"2025-04-13T00:46:18.122Z","repository":{"id":38552008,"uuid":"212509528","full_name":"richardeschloss/nuxt-socket-io","owner":"richardeschloss","description":"Nuxt Socket IO - socket.io client and server module for Nuxt","archived":false,"fork":false,"pushed_at":"2023-07-25T02:22:16.000Z","size":3588,"stargazers_count":264,"open_issues_count":1,"forks_count":35,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T00:46:12.803Z","etag":null,"topics":["nuxt","nuxt-socket-io","socket","socket-io","vue","vuejs"],"latest_commit_sha":null,"homepage":"https://nuxt-socket-io.netlify.app","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richardeschloss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"richardeschloss","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-10-03T06:17:32.000Z","updated_at":"2024-12-07T14:03:42.000Z","dependencies_parsed_at":"2024-01-13T14:49:50.130Z","dependency_job_id":"b34330a8-28f5-4bed-bc69-d54cbe857d7a","html_url":"https://github.com/richardeschloss/nuxt-socket-io","commit_stats":{"total_commits":446,"total_committers":12,"mean_commits":"37.166666666666664","dds":0.047085201793722,"last_synced_commit":"aa0216b339fa531c203e35970325095ca5a80e69"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fnuxt-socket-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fnuxt-socket-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fnuxt-socket-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fnuxt-socket-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardeschloss","download_url":"https://codeload.github.com/richardeschloss/nuxt-socket-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650432,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nuxt","nuxt-socket-io","socket","socket-io","vue","vuejs"],"created_at":"2024-08-01T01:00:55.840Z","updated_at":"2025-04-13T00:46:18.095Z","avatar_url":"https://github.com/richardeschloss.png","language":"JavaScript","funding_links":["https://github.com/sponsors/richardeschloss"],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"readme":"[![npm](https://img.shields.io/npm/v/nuxt-socket-io.svg)](https://www.npmjs.com/package/nuxt-socket-io)\n[![npm](https://img.shields.io/npm/dt/nuxt-socket-io.svg)](https://www.npmjs.com/package/nuxt-socket-io)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/richardeschloss/nuxt-socket-io/test.js.yml?branch=master)\n[![](https://gitlab.com/richardeschloss/nuxt-socket-io/badges/master/coverage.svg)](https://gitlab.com/richardeschloss/nuxt-socket-io)\n[![NPM](https://img.shields.io/npm/l/nuxt-socket-io.svg)](https://github.com/richardeschloss/nuxt-socket-io/blob/development/LICENSE)\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n# nuxt-socket-io\n\n[Socket.io](https://socket.io/) client and server module for Nuxt\n\n## Features\n- Configuration of multiple IO sockets\n- Configuration of per-socket namespaces (simplified format)\n- Automatic IO Server Registration\n- Socket IO Status\n- Automatic Error Handling\n- Debug logging, enabled with localStorage item 'debug' set to 'nuxt-socket-io'\n- Automatic Teardown, enabled by default\n- $nuxtSocket vuex module and socket persistence in vuex\n- Support for dynamic APIs using the KISS API format\n- Support for the IO config in the new Nuxt runtime config (for Nuxt versions \u003e= 2.13)\n- Automatic middleware registration\n- ES module\n- Experimental support for ioRedis\n\n# Important updates\n\n* v3.x has been tested against Nuxt3 stable and socket.io@4.1.1. If you absolutely require socket.io@4.5.3 it's recommended to install it and follow the [workaround](https://github.com/richardeschloss/nuxt-socket-io/issues/278#issuecomment-1287133733). \n* v2.x may contain breaking changes in it's attempt to get Nuxt3 reaady. `npm i nuxt-socket@1` should help revert any breaking changes in your code.\n  * VuexOpts types and Namespace configuration types changed. Entries with the `Record\u003cstring, string\u003e` have been deprecated in favor of string-only entries, which are easier to work with.\n  * Package type is now \"module\". Entirely ESM.\n  * Tested against node lts (16.x). \n* v1.1.17+ uses socket.io 4.x. You may find the migration [here](https://socket.io/docs/v4/migrating-from-3-x-to-4-0/)\n* v1.1.14+ uses socket.io 3.x. You may find the migration [here](https://socket.io/docs/v4/migrating-from-2-x-to-3-0/)\n* v1.1.13 uses socket.io 2.x.\n\n# Setup\n\n1. Add `nuxt-socket-io` dependency to your project\n\n* Nuxt 3.x:\n```bash\nnpm i nuxt-socket-io\n```\n\n* Nuxt 2.x:\n```bash\nnpm i nuxt-socket-io@2\n```\n\n2. Add `nuxt-socket-io` to the `modules` section of `nuxt.config.js`\n\n```js\n{\n  modules: [\n    'nuxt-socket-io',\n  ],\n  io: {\n    // module options\n    sockets: [{\n      name: 'main',\n      url: 'http://localhost:3000'\n    }]\n  }\n}\n```\n\n3. Use it in your components:\n\n```js\n{\n  mounted() {\n    this.socket = this.$nuxtSocket({\n      channel: '/index'\n    })\n    /* Listen for events: */\n    this.socket\n    .on('someEvent', (msg, cb) =\u003e {\n      /* Handle event */\n    })\n  },\n  methods: {\n    method1() {\n      /* Emit events */\n      this.socket.emit('method1', {\n        hello: 'world' \n      }, (resp) =\u003e {\n        /* Handle response, if any */\n      })\n    }\n  }\n}\n```\n\n## Documentation\n\nBut WAIT! There's so much more you can do!! Check out the documentation:\n\u003e https://nuxt-socket-io.netlify.app/\n\nThere you will see:\n- More details about the features, configuration and usage\n\n### Resources\n\n- Follow me and the series on [medium.com](https://medium.com/@richard.e.schloss)\n- Socket.io Client docs [here](https://socket.io/docs/v4/client-api/)\n- Socket.io Server docs [here](https://socket.io/docs/v4/server-api/)\n\n\n## Development\n\n1. Clone this repository\n2. Install dependencies using `yarn install` or `npm install`\n3. Start development server using `yarn dev` or `npm run dev`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardeschloss%2Fnuxt-socket-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardeschloss%2Fnuxt-socket-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardeschloss%2Fnuxt-socket-io/lists"}