I am integrating Dialogflow CX with React and Node.js. I want to retrieve the chat parameter on the React side when the session ends. Is there a way to achieve this?
I want the javascript function to get the parameter when the session ends so I can send the parameter to the backend with the current login user ID.
Alright, I’d like a JavaScript function similar to those mentioned in the Dialogflow CX documentation. For instance, I’ll provide an example in the message. I’m looking for a function similar to df-response-received that captures the chat parameter when the session ends. Are any other functions available for this purpose?
// response received event
window.addEventListener(“df-response-received”, (event) => {
– get parameter from event object and stored in the state(used VUE JS)
parameters.value=event?.detail?.raw?.query result?.parameters
});
// session end event
window.addEventListener(“df-session-ended”, () => {
//Here we can get the value of the session parameter and send all parameters to the database with user credentials so it stores with corresponding user
});
});