nuxt-laravel-echo
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

Nuxt Laravel Echo

npm version npm downloads License Nuxt

Nuxt module for Laravel Echo integration to get a seamless experience with application broadcasting.

Features

  • Sanctum-based authentication
  • CSRF cookie management for Private and Presence channels
  • CSR-only mode
  • TypeScript support

Note: Before using this module, make sure you have a Laravel Echo server running and properly configured.

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add nuxt-laravel-echo

Then provide the configuration in your nuxt.config.js:

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:

export default defineNuxtConfig({
  vite: {
    optimizeDeps: {
      include: ['pusher-js'],
    },
  },
})

That's it! You can now use Nuxt Laravel Echo in your Nuxt app ✨

Contribution

If you want to contribute to this project and make it better, your help is very welcome. Check the Contribution Guide for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-laravel-echo

Weekly Downloads

122

Version

0.0.12

License

MIT

Unpacked Size

14.6 kB

Total Files

19

Last publish

Collaborators

  • manchenkoff