-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat.js
29 lines (27 loc) · 892 Bytes
/
chat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Talk.ready.then(function () {
var me = new Talk.User({
id: '123456',
name: 'Alice',
email: 'alice@example.com',
photoUrl: 'https://demo.talkjs.com/img/alice.jpg',
welcomeMessage: 'Hey there! How are you? :-)',
});
window.talkSession = new Talk.Session({
appId: 'tm41CwfV',
me: me,
});
var other = new Talk.User({
id: '654321',
name: 'Sebastian',
email: 'Sebastian@example.com',
photoUrl: 'https://demo.talkjs.com/img/sebastian.jpg',
welcomeMessage: 'Hey, how can I help?',
});
var conversation = talkSession.getOrCreateConversation(
Talk.oneOnOneId(me, other)
);
conversation.setParticipant(me);
conversation.setParticipant(other);
var inbox = talkSession.createInbox({ selected: conversation });
inbox.mount(document.getElementById('talkjs-container'));
});