CHAT Plugin

This plugin is an in-app chat interface that allows users to communicate within the application. It displays a list of contacts on the left, and each entry includes a name, organization, and avatar. Users can select a contact from the list to initiate a conversation, which appears in the main chat window on the right. The bottom of the interface provides a text input field for sending messages. It integrates smoothly into the app's UI, providing a collaborative communication tool.

Demo version

Plugin options interface

interface PluginOptions {
  selector?: string
  settings?: {}
}

Example

<!DOCTYPE html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dat Chat Vite</title>
    <script type="module" crossorigin src="https://plugins.wedat.eu/chat/plugin.js"></script>
    <link rel="stylesheet" crossorigin href="https://plugins.wedat.eu/chat/plugin.css" />
  </head>
  <body>
    <div id="root"></div>
    <script>
      document.addEventListener('DOMContentLoaded', () => {
        window.CHAT_API &&
          window.CHAT_API.init({
            selector: '#root',
            onComplete: values => {
              console.log(JSON.stringify(values, null, 4));
            },
            contractId: 48782356,
            credentials: {
              customerNumber: '3131411',
              user: 'ferrsimo',
              password: 'ferrsimo01'
            }
          });
      });
    </script>
  </body>
</html>