Cokpit Chat Widget

Widget de chat flutuante estilo LinkedIn para sistemas

🎮 Controles de Demonstração

Gerenciar Lista de Chats

Controle a aba principal de mensagens no canto inferior direito.

Controles de Chats

Gerencie os chats abertos individualmente ou em conjunto.

Abrir Chats Específicos

Teste com contatos mockados diferentes.

🔧 Como Integrar

1. Instalação Básica

// Adicione o script ao seu HTML <script src="https://cdn.exemplo.com/crm-chat-widget.js"></script> // Inicialize o widget <script> window.CRMChatSDK.init({ theme: 'linkedin', position: 'bottom-right', autoOpen: false }); </script>

2. Configuração Avançada

const chatWidget = window.CRMChatSDK.init({ theme: 'linkedin', position: 'bottom-right', autoOpen: true, callbacks: { onInit: () => console.log('Widget inicializado'), onChatOpen: (contactId) => console.log('Chat aberto:', contactId), onChatClose: (contactId) => console.log('Chat fechado:', contactId) } }); // Controle programático chatWidget.openChat('user123'); chatWidget.minimizeAllChats(); chatWidget.show(); chatWidget.hide();

3. Eventos e Callbacks

// Adicionar listeners de eventos chatWidget.on('chatOpen', (contactId) => { // Lógica quando um chat é aberto console.log('Novo chat aberto:', contactId); }); chatWidget.on('messageReceived', (message) => { // Lógica para mensagens recebidas console.log('Nova mensagem:', message); });