Help in Botfront webchat

Hi , i’m trying webchat by botfront. I got it running but how do i make it open by default.

<!DOCTYPE html>
<html lang="en">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<head>
  <link rel=icon href="1.png">
  <title>hello</title>
  <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style_new.css">
</head>

<body>
  <div id="webchat"/>

<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(
        {
          customData: { language: "en" },
          socketUrl: "https://bf-botfront.development.agents.botfront.cloud",
          storage:"session"
        },
        null
      );
    }),
    t.insertBefore(e, t.firstChild);
})();
window.WebChat.Open()
</script>
</body>
</html>

I’m tryin this , but this doesn’t work. Please help me get this open by default and not on click.

Thanks in Advance.

Hi! We’re not the creators of Botfront, and I can only help you with Rasa-related questions. This looks more like a web design issue. I think you should ask your question to the Botfront community here

1 Like