The core team is working on a SSE package for v6, but we're staying on v5 for a while until the ecosystem catches up to the changes. So we'll need a better implementation of SSE events and this is what I was thinking.
The package registers a service provider that sets up an endpoint /events to connect to with a EventSource object on the client side. It also publishes a config/sse.ts file that from the top of my head just gives a you the ability to define what events can be broadcasted to the endpoint from the built in Event system.
The core team is working on a SSE package for v6, but we're staying on v5 for a while until the ecosystem catches up to the changes. So we'll need a better implementation of SSE events and this is what I was thinking.
The package registers a service provider that sets up an endpoint
/events
to connect to with aEventSource
object on the client side. It also publishes aconfig/sse.ts
file that from the top of my head just gives a you the ability to define what events can be broadcasted to the endpoint from the built inEvent
system.So say you have this in your config:
This will then start listening and broadcasting all
chat:
prefixed events to the endpoint. So in your application you can just do:This will then broadcast that event details to the client side.