client.response.data event from the client SDK. The payload arrives at your webhook as a data event without interrupting the current turn. The webhook can respond with a regular JSON response (not an SEE stream like other webhook event types), which is then delivered immediately back to the client as a response.data event.
This data flow is in addition to the ability of other webhook event types (like message or session.start) returning response.data SEE events, which are also sent to the client as response.data events.
Vanilla JS example
send-data.html
- The current turn continues uninterrupted.
- The payload is forwarded as a
datawebhook event with the session/turn identifiers.
React example
app/components/OrderActions.tsx
Backend example
When the client emitsclient.response.data, your webhook receives a data event. Respond with plain JSON (not SSE messages) using type: "response.data". The payload is delivered to the client and surfaced via the onDataMessage callback.
The snippet below only handles the data event for clarity:
Express
onDataMessage (the same applies to the React SDK):