botpress_userData_issue

by Erik

HTML

<html lang="en">
  <header></header>
  <body></body>
</html>

JavaScript

var script = document.createElement('script');
script.src = 'https://cdn.botpress.cloud/webchat/v1/inject.js';
document.head.appendChild(script);


script.onload = function() {
    if (window.botpressWebChat && typeof window.botpressWebChat.init === 'function') {
    	
      window.botpressWebChat.init({
          "composerPlaceholder": "Chat with bot",
          "botConversationDescription": "This chatbot was built surprisingly fast with Botpress",
          "botId": "e9f6b47f-8771-4654-9677-269ceee133eb",
          "hostUrl": "https://cdn.botpress.cloud/webchat/v1",
          "messagingUrl": "https://messaging.botpress.cloud",
          "clientId": "e9f6b47f-8771-4654-9677-269ceee133eb",
          "lazySocket": true,
          "frontendVersion": "v1",
          "showPoweredBy": true,
          "enableConversationDeletion": true,
          "userData": {"url": "init-value"},
      });

    } else {
        console.error("botpressWebChat.init is not available!");
    }
};