Overview:
The DeepSource module is a websocket dependency for Nuxt v2. It allows for WebSocket connections and provides a Vue instance and WebSocketManager instance for easy handling of events and data transmission.
Features:
- WebSocket connection: Establish a WebSocket connection using the provided URL.
- Reconnection: Automatically attempts reconnection for a close event that is not normal.
- Runtime Config: Provide the WebSocket URL via runtime config, which takes precedence over options.
- Vue instance and WebSocketManager instance: Accessible across the app, allows for easy handling of events and data transmission.
Installation:
To install the DeepSource module, follow these steps:
Add the
@deepsource/nuxt-websocketdependency to your project.npm install @deepsource/nuxt-websocketAdd
@deepsource/nuxt-websocketto the modules section of yournuxt.config.jsfile.modules: [ '@deepsource/nuxt-websocket', ]If using TypeScript, add the types to your types array in the
tsconfig.jsonfile after the@nuxt/typesentry (Nuxt 2.9.0+).{ "compilerOptions": { "types": [ "@nuxt/types", "@deepsource/nuxt-websocket" ] } }
Summary:
The DeepSource module for Nuxt v2 provides easy handling of WebSocket connections and data transmission. It allows for automatic reconnection, runtime config, and provides a Vue instance and WebSocketManager instance for seamless integration with your application. Follow the installation guide to start using DeepSource in your Nuxt project.