{"_id":"@anycable/echo","_rev":"2-bc67c8298903b4e5b53993e558f10f06","name":"@anycable/echo","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@anycable/echo","version":"0.1.0","keywords":["anycable","laravel","websockets"],"author":{"name":"Vladimir Dementyev"},"license":"MIT","_id":"@anycable/echo@0.1.0","maintainers":[{"name":"hellsquirrel","email":"zloymult@gmail.com"},{"name":"palkan","email":"dementiev.vm@gmail.com"}],"homepage":"https://anycable.io/","bugs":{"url":"https://github.com/anycable/anycable-client/issues"},"dist":{"shasum":"006b3620b7e13dc5bf10aee5b74ca2c96051a0d4","tarball":"https://registry.npmjs.org/@anycable/echo/-/echo-0.1.0.tgz","fileCount":7,"integrity":"sha512-CoV9O7wgfTVjSKJ5+x7vtF9b3Q10t4KR1hJYQrw9S/thfLEbGkNS1dI2u3BfdOxpaSNbZKlAba91KVTjnx2hZg==","signatures":[{"sig":"MEUCIQDHk3c6vyt9PHy/25kU72QywM1L94pyazHbn3sqPK+d9wIgaukhSfBzOgrJ+xu7W6UzCJixCB3QDtdcqetvDo2sKUQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14092},"main":"index.js","type":"module","types":"./index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"999a6905c1b456c3c1c4fd6203c54a58281ec85f","_npmUser":{"name":"palkan","email":"dementiev.vm@gmail.com"},"repository":{"url":"git+https://github.com/anycable/anycable-client.git","type":"git"},"_npmVersion":"10.8.2","description":"AnyCable broadcaster adapter for Laravel Echo","directories":{},"sideEffects":false,"_nodeVersion":"20.19.0","dependencies":{"@anycable/web":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"laravel-echo":">= 2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/echo_0.1.0_1753761711086_0.8487031969957348","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@anycable/echo","version":"0.1.1","description":"AnyCable broadcaster adapter for Laravel Echo","engines":{"node":">=18.0.0"},"keywords":["anycable","laravel","websockets"],"homepage":"https://anycable.io/","repository":{"type":"git","url":"git+https://github.com/anycable/anycable-client.git"},"author":{"name":"Vladimir Dementyev"},"license":"MIT","sideEffects":false,"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":"./index.js","./package.json":"./package.json"},"dependencies":{"@anycable/web":"^1.1.0"},"devDependencies":{"laravel-echo":">= 2.1.0"},"_id":"@anycable/echo@0.1.1","gitHead":"d25849799ef670ceb30bf64397a8bf349cdc0010","bugs":{"url":"https://github.com/anycable/anycable-client/issues"},"_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-lyIh1w8eieXs/e1JEO3T2HDbONCNHINAsVfk9mWHVkswi4PYeS/2jyl0v3JxAAS8ACrpxXNdUVHA+Bo6dlw6Kg==","shasum":"40accc9f85f69dab2eaf045291b90f79e5df07a2","tarball":"https://registry.npmjs.org/@anycable/echo/-/echo-0.1.1.tgz","fileCount":8,"unpackedSize":14810,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/8HaUyqkSGhCpp/KEPJE2Cy7OKT1Jdd88f0iP0EEF5gIhANLuDG0AVcx0EuFxePJlFgwP4rwWtmDJvG60y9TAvBbt"}]},"_npmUser":{"name":"palkan","email":"dementiev.vm@gmail.com"},"directories":{},"maintainers":[{"name":"hellsquirrel","email":"zloymult@gmail.com"},{"name":"palkan","email":"dementiev.vm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/echo_0.1.1_1753763397427_0.08554880376334872"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-29T04:01:50.984Z","modified":"2025-07-29T04:29:57.840Z","0.1.0":"2025-07-29T04:01:51.253Z","0.1.1":"2025-07-29T04:29:57.608Z"},"bugs":{"url":"https://github.com/anycable/anycable-client/issues"},"author":{"name":"Vladimir Dementyev"},"license":"MIT","homepage":"https://anycable.io/","keywords":["anycable","laravel","websockets"],"repository":{"type":"git","url":"git+https://github.com/anycable/anycable-client.git"},"description":"AnyCable broadcaster adapter for Laravel Echo","maintainers":[{"name":"hellsquirrel","email":"zloymult@gmail.com"},{"name":"palkan","email":"dementiev.vm@gmail.com"}],"readme":"[![npm version](https://badge.fury.io/js/%40anycable%2Fecho.svg)](https://badge.fury.io/js/%40anycable%2Fecho)\n\n# AnyCable Echo\n\nAnyCable adapter for [Laravel Echo][].\n\n## Usage\n\nConfigure your global Echo object as follows to use AnyCable _cable_ instance under the hood. The minimal configuration is as follows:\n\n```js\nimport { EchoCable } from '@anycable/echo';\n\nwindow.Echo = new Echo({\n  broadcaster: EchoCable\n});\n```\n\nBy default, AnyCable looks up a connection URL in the `<meta name=\"cable-url\">` tag. You can also provide the URL explicitily as well as other options supported by AnyCable:\n\n```js\nimport { EchoCable } from '@anycable/echo';\n\nwindow.Echo = new Echo({\n  broadcaster: EchoCable,\n  // AnyCable client configuration\n  cableOptions: {\n    url: \"ws://<your-anycable-host:port/cable\",\n    protocol: \"actioncable-v1-ext-json\" // this version supports presence and streams history\n  },\n  // other options\n  auth: {\n    headers: {\n      'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]')?.getAttribute('content') || '',\n    },\n  },\n});\n```\n\nThat's it! Now you can use your Echo instance as before.\n\nAnd don't forget to switch to [AnyCable broadcasting adapter][anycable-laravel] at the server side.\n\nYou can also pass an already created cable instance as an option instead of `cableOptions` (for example, if you want to reuse the connection outside of Echo):\n\n```js\nimport { createCable } from '@anycable/web';\nimport { EchoCable } from '@anycable/echo';\n\n// First, create a cable instance and configure it as you need\nconst cable = createCable();\n\n// Then, pass a cable broadcaster as a broadcaster option to the Echo constructor.\n// Note that no other WebSocket configuration is requried—you must only configure the cable instance.\nwindow.Echo = new Echo({\n  broadcaster: Echo,\n  cable,\n});\n```\n\n[Laravel Echo]: https://github.com/laravel/echo\n[anycable-laravel]: https://github.com/anycable/anycable-laravel\n","readmeFilename":"README.md"}