I'm using laravel-echo and pusher-js in a projetct with Laravel and VueJS and it works.
But now I need to broadcast in a VueJS project without laravel (a pure VueJS project).
I don't know how to install and configure laravel-echo and laravel-pusher in a pure project VueJS.
I try to do llike this, but don't works:
import Echo from "laravel-echo";
window.Pusher = require("pusher-js");
window.Echo = new Echo({
broadcaster: "pusher",
key: "myappkey",
cluster: "mt1",
host: window.location.hostname + ":6001",
});
Vue.use(Echo);
The 2 packages are in my package.json:
"laravel-echo": "^1.11.2",
"pusher-js": "^7.0.3",