In NestJs it is quite easy to manage in the backend, there's a SSE decorator for you SSE service and then you just return an observable on a subject. (See RxJs)
Sending message events sends to all observers on the subject and when the `observed` property` becomes false, you just close the connection.