Call a function in javascript when user enter a message in chatbot

Hi, I want to access the information of the chat from the javascript code. Can anyone help me with this. My exact problem is that based on the message entered by the user, i have to show a video in my website. so i want to access the chat data in javascript code of my website

Hacky way: You let the bot respond with the necessary data and a key word to the javascript frontend. The frontend parses the answer, recognizes keyword and shows the video according to the transmited data.

Nice way: You write a custom action server in JS, which Rasa is gonna use for processing the data and sending the right video back as a response. Now your frontend only has to be able to display the “video : http//link.to.video.mp4” object in your response JSON.

Hi sugarshock, Thanks for replying. In the Hacky way, how to send keyword to javascript frontend from the bot.