A Nuxt module for seamless WebSocket integration with type-safe messaging, file-based routing, auto-reconnection, and support for multiple external WebSocket connections. Current stable version is 4.1.2, actively maintained with regular releases. Key differentiators include file-based event routing similar to Nitro Routes, TypeScript-first design with full type inference, and built-in support for both client and server-side handlers within Nuxt 3 projects.
npm install nuxt-easy-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with Nuxt config, client composable usage (send/on events), server-side handler, and client-side event registration.
Remove manual imports; rely on Nuxt 3 auto-imports.
Rename directories or set 'clientSrcDir' and 'serverSrcDir' in config.
Use 'ws.connect(url, name)' programmatically instead of config.
Ensure client handlers are under 'app/socket/' and server handlers under 'server/socket/'.
Remove import statement; use composable directly without import.
Ensure Nuxt dev server is running and WebSocket is enabled (default). Use correct port.
Only call useWebSocket() inside a component's setup or a composable that runs after app mount.