How to broadcast new orders to admin panel in real-time using nuxt-hub realtime or websockets?
Hi Nuxt Hub team,
I'm working on implementing real-time order updates using nuxt-hub in my Nuxt-based e-commerce website. I've successfully established a WebSocket connection within my routes, following the documentation.
Now, I’d like to notify the admin panel in real time when a new order is placed. Is there a recommended way to use something like:
await useHubWs().broadcast('orders', savedOrder);
...to broadcast the new order to connected clients (e.g., the admin panel)?
What would be the best practice to achieve this functionality using Nuxt Hub?
Thanks in advance!
crossws v0.4.0 has introduced global publish to the Cloudflare adapter, and namespaces in pub/sub so this should be possible soon :) https://github.com/h3js/crossws/releases/tag/v0.4.0
I also have a similar requirement; my real-time interface should receive WebSocket notifications when a user visits
https://sink.cool/dashboard/realtime
is there any workaround until that's possible?