Nuxt module for Laravel Echo integration
npm install nuxt-laravel-echo[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]
Nuxt module for Laravel Echo integration to get a seamless experience with application broadcasting.
- Documentation
- Features
- Quick Setup
- Release Notes
This module includes a range of features designed to streamline broadcasting:
- Sanctum-based authentication
- CSRF cookie and token management for Private and Presence channels
- CSR-only mode (plugin is not loaded in SSR)
- TypeScript support
- Simple configuration
- Request interceptors, token storage, composables and more...
Note: Before using this module, make sure you have a Laravel Echo server running and properly configured.
Install the module to your Nuxt application with one command:
``bash`
npx nuxi module add nuxt-laravel-echo
Then provide the configuration in your nuxt.config.js:
`typescript
export default defineNuxtConfig({
modules: ["nuxt-laravel-echo"],
echo: {
key: "REPLACE_ME", // Your Laravel Echo app key
authentication: {
baseUrl: "laravel.test", // Your Laravel app URL
},
},
});
`
Also, to enable Dev server compatibility with Pusher, you need to add the following Vite configuration to your nuxt.config.js:
`typescript``
export default defineNuxtConfig({
vite: {
optimizeDeps: {
include: ["nuxt-laravel-echo > pusher-js"],
},
},
});
That's it! You can now use Nuxt Laravel Echo in your Nuxt app ✨
If you want to contribute to this project and make it better, your help is very welcome. Check the Contribution Guide for more information.
[npm-version-src]: https://img.shields.io/npm/v/nuxt-laravel-echo/latest.svg?style=flat&colorA=020420&colorB=00DC82
[npm-version-href]: https://npmjs.com/package/nuxt-laravel-echo
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-laravel-echo.svg?style=flat&colorA=020420&colorB=00DC82
[npm-downloads-href]: https://npm.chart.dev/nuxt-laravel-echo
[license-src]: https://img.shields.io/npm/l/nuxt-laravel-echo.svg?style=flat&colorA=020420&colorB=00DC82
[license-href]: https://npmjs.com/package/nuxt-laravel-echo
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
[nuxt-href]: https://nuxt.com
