How to deploy rasa chatbot on wordpress website

Hi, I have created a website using wordpress now i want to deploy my rasa chatbot in this website. can someone help me to deploy my chatbot.

Thanks in advance.

You should be able to include custom JavaScript using this plugin:

Then you’ll need to use a chat widget like:

To use that widget specifically, you’ll need to enable web sockets by adding the following to your credentials.yml file:


socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true/false

You then can access your bot endpoint through http://<your_ip>:<port>/webhooks/socketio/webhook and point the chat widget there through its configuration.

For more information on web sockets check the documentation here:

Please let us know if that works.

Hi @kearnsw Thanks for your valuable details, So, i tried to connect the frontend chatroom locally,but it is not responding. I am using ngrok as a server, i am confused which port should i use to run my frontend chatbot : The one that i declared in action_endpoints ? And also which port address should i give in the socketUrl in the html file?

Hi Rahul,

The default port is 5005. The action server by default runs on 5055 and only needs to be enabled in the endpoints.yml file. So your fully qualified URL running locally http://localhost:5005/webhooks/socketio/webhook

So, i run my ngrok server on 5005 and add socketio url in script and run the following commands in terminal :

rasa run --m models --endpoints endpoints.yml --port 5005 -vv --enable-api --credentials credentials.yml

rasa run actions

Then i run my html code but it still not responding to my inputs. I am getting this error in debug console :

Error: xhr poll error

at u.i.onError (:23:20736)
at l.<anonymous> (:127:166032)
at l.r.emit (:5:78901)
at l.onError (:127:167870)
at https://cdn.jsdelivr.net/npm/rasa-webchat/lib/index.min.js:127:167444 {type: 'TransportError', description: 0, stack: 'Error: xhr poll error
at u.i.onError (htt…/npm/rasa-webchat/lib/index.min.js:127:167444', message: 'xhr poll error'}

Can you try to add the following flag to the first rasa run command listed above: --cors=“*” and see if that resolves the issue?

Are you seeing the traffic coming through on ngrok?

If not, can you provide your rasa-webchat configuration?

If so, can you provide your endpoints.yml configuration?

Hello!

I am having the same error

   Error: xhr poll error. 

Both the webpage and Rasa endpoint are running to the same server. Nothing is shown in the page except this error in the console. I am running rasa like that:

   rasa run -m models --enable-api --cors "*" --debug

Also the chatbot is working correctly, If i use this chatroom GitHub - scalableminds/chatroom: React-based Chatroom Component for Rasa Stack

This is my code:

  <script>
  !(function () {
   let e = document.createElement("script"),
    t = document.head || document.getElementsByTagName("head")[0];
     (e.src = "https://cdn.jsdelivr.net/npm/rasa-webchat/lib/index.js"),
      (e.async = !0),
      (e.onload = () => {
        window.WebChat.default(
        {
          socketUrl: "http://localhost:5005",
          // add other props here
        },
        null
      );
    }),
    t.insertBefore(e, t.firstChild);
 })();

This is what I can see in the server

 The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)

Thank you