JSFiddle - React, Tailwind, and code Playground

by devmik

HTML

<html>
<body>
<h1>Triggers Example!</h1>
<p>Automatically open the chatbot</p>
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script src="https://mediafiles.botpress.cloud/339bacc9-fbfa-4650-9039-3a12e86bda7e/webchat/config.js" defer></script>

<script>
  // JavaScript code to handle the event when the entire page has fully loaded
  window.onload = function() {
    console.log("showing bot...");
    // Ensure window.botpressWebChat is available
    if (window.botpressWebChat) {
      window.botpressWebChat.sendEvent({ type: "show" });
    } else {
      console.error("Botpress Web Chat is not available.");
    }
  };
</script>
</body>
</html>

CSS

body {
  background-color: brown;
}