Hi Glean Support Team,
I hope you're doing well.
We're currently using the Glean Web SDK (@gleanwork /web-sdk@2 .1.0) and embedding the chat experience into our application using the renderChat()
method. While the integration itself is working smoothly, we have a specific requirement that we’re currently unable to fulfill:
🔍 Our Use Case
We would like to detect when a user sends a message via the chat input — ideally by:
- Capturing the click event on the chat "Send" button (or equivalent event),
- Accessing the message content typed by the user.
Our goal is to use this data for:
- Logging and analytics
- Triggering application-side workflows
- Enabling better monitoring of assistant usage
🧩 Current Limitations
- The SDK provides a helpful
onChat
callback when a chat session starts, but there doesn’t appear to be a way to listen for individual message submissions. - We could not find any
onMessageSent
, onSubmit
, or event hooks exposed by renderChat()
or the returned ChatHandle
. - Since the widget often runs in a sandboxed iframe, we cannot directly access DOM events or internal state (e.g.
input
values or click handlers). - We also tried inspecting network traffic, and while the
/chat
API is triggered, intercepting fetch
calls isn't reliable or allowed in all environments.
🙏 Our Request / Questions
- Is there currently any officially supported way (e.g. via SDK event, DOM event, or postMessage) to capture when a user sends a chat message and retrieve its content?
- If not available today, is there any planned support for:
- An
onMessageSent(message: string)
callback in ChatOptions
? - A
ChatHandle.on('messageSent', callback)
listener? - Or at least
postMessage
event dispatch from the iframe to the host app?
We believe this would unlock a lot of meaningful use cases for integrators and would be happy to provide feedback or join a discussion to explore this further.
Thanks again for building such a great SDK — and looking forward to your response ASAP please.