Consuming Server-Sent-Events with Retool

I have a system which provides an API that uses server-sent-events to push live information about the system status as well as events. I've tried a few things to try and consume these events but nothing seems to have worked.

Right now the user-experience is pretty horrid as the app has to poll the API every 2 seconds for data which is clunky, slow, and causes the status icons to spend a lot of time in the loading state.

Should be possible, you'll likely need to write some code in the "preloaded JS" section of your app to initiate the new EventSource() object at the window level, and then some js code in your app to listen for those events once you've exposed it.

What have you tried so far and where is the issue you're having?

Hey @LeoAdamek - thanks for reaching out. Retool itself doesn't have native support for consuming SSEs. We do have an early implementation of REST API response streaming that you could test out, but I don't believe it supports long-lived connections.

The most robust solution is to build out a custom component that utilizes web sockets in order to maintain a long-lived connection to your API. Let me know if you have any questions about getting started!

Have you had a chance to revisit this, @LeoAdamek? I'm curious to know what you've tried previously and if any of our suggestions might be feasible.