Deploying your bot

This is a sample embed code. When you create a chatbot (on platforms “Web Chat Widget” and “Article Embed”), similar code is shown which you can embed on your website.

<div id="embed">
<script src='https://app.hybrid.chat/scripts/welcome.js'>
</script>
<script>
welcome('botId' , 'hybrid.chat', {"loadHistory": false});
</script>
</div>

The embed code supports some parameters which decides how chatbot loads and operates.

  1. loadHistory – default value is true. When this value is set to true, the bot will load message history when a user comes back. If it’s set to false, message history won’t load.
  2. showWelcomeMessage – default value is true. When this value is set to true, the welcome message is shown in the widget. If this value is false, then the widget will not load and only a chat icon will be shown.
  3. openChatDirectly – default value is false. When this value is set to true, the chat window will open directly without user interaction. If it’s set to false, then the chat icon will be shown and the chat window will open only when the user opens it.
  4. vars – any external variables that you want to use in the bot can be passed from here. An example use case is sending the username of a user after he logs in to your website.

Here is an example using all of these parameters –

<div id="embed">
<script src='https://app.hybrid.chat/scripts/welcome.js'>
</script>
<script>
welcome('botId' , 'hybrid.chat', 
{"loadHistory": false, "showWelcomeMessage": true,
"openChatDirectly": false, "vars": {"name": "somename"}});
</script>
</div>