lucianotonet / MavChatEmbed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mav Chat

Javascript library to display agenciamav chatbot on your website

Agência Mav

Install:

yarn install

Dev:

yarn dev

Build:

yarn build

Embed in your HTML

<script type="module">
  import MavChat from "https://cdn.jsdelivr.net/npm/mav-chat-embed/dist/web.js";
  MavChat.init({
    chatflowid: "<chatflowid>",
    apiHost: "http://localhost:3000",
  });
</script>

Configuration

You can also customize chatbot with different configuration

<script type="module">
  import MavChat from "https://cdn.jsdelivr.net/npm/mav-chat-embed/dist/web.js";
  MavChat.init({
    chatflowid: "91e9c803-5169-4db9-8207-3c0915d71c5f",
    apiHost: "http://localhost:3000",
    theme: {
      button: {
        backgroundColor: "#3B81F6",
        right: 20,
        bottom: 20,
        size: "medium",
        iconColor: "white",
        customIconSrc:
          "https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg",
      },
      chatWindow: {
        welcomeMessage: "Hello! This is custom welcome message",
        backgroundColor: "#ffffff",
        height: 700,
        width: 400,
        poweredByTextColor: "#303235",
        botMessage: {
          backgroundColor: "#f7f8ff",
          textColor: "#303235",
          showAvatar: true,
          avatarSrc:
            "https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png",
        },
        userMessage: {
          backgroundColor: "#3B81F6",
          textColor: "#ffffff",
          showAvatar: true,
          avatarSrc:
            "https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png",
        },
        textInput: {
          placeholder: "Type your question",
          backgroundColor: "#ffffff",
          textColor: "#303235",
          sendButtonColor: "#3B81F6",
        },
      },
    },
  });
</script>

License

Source code in this repository is made available under the MIT License.

About


Languages

Language:TypeScript 78.1%Language:CSS 15.3%Language:JavaScript 6.6%