I was hoping for similar functionality. So far, the only idea I’ve come up with (but would require a heavy lift) is having some sort of parallel system that can communicate w/ the browser via websockets.
A code snippet or webhook chatbot step would pass along info to that second system, which could then relay events back to the browser.
But you’d need a good correlation ID to pass between the systems. The chat widget SDK does give you a conversation ID that you can listen for, but it doesn’t appear conversation ID is passed to either code snippet or webhook actions. What is passed to those actions is a contact VID for known contacts. So, if your use case doesn’t need to support anonymous visitors, that might be your best bet.
Otherwise, I think we’re left with lobbying Hubspot to either: 1) include conversation ID in the webhook and/or code snippet payloads, or 2) let us set custom state for the conversation from the client side that could be passed along to the appropriate chatbot actions.