Two independent chat widgets that send messages to each other. Each instance has its own history, theme, and callbacks.
const chat1 = new quikchat('#chat1', null, {
theme: 'quikchat-theme-light',
titleArea: { title: 'Sue Smith', align: 'left', show: true }
});
const chat2 = new quikchat('#chat2', null, {
theme: 'quikchat-theme-dark',
titleArea: { title: 'Pat Park', align: 'left', show: true }
});
// Cross-post messages between widgets
chat1.setCallbackOnSend((c, msg) => {
c.messageAddNew(msg, 'Sue', 'right');
chat2.messageAddNew(msg, 'Sue', 'left');
});
chat2.setCallbackOnSend((c, msg) => {
c.messageAddNew(msg, 'Pat', 'right');
chat1.messageAddNew(msg, 'Pat', 'left');
});