Talk.ready.then(function() {
var me = new Talk.User({
id: "<%= me.id %>",
name: "<%= me.name %>",
email: "<%= me.email %>",
photoUrl: "<%= me.photo_url %>",
welcomeMessage: "Hey there! How can I help you today?"
});
window.talkSession = new Talk.Session({
appId: "<APP_ID>",
me: me
});
var other = new Talk.User({
id: "<%= other.id %>",
name: "<%= other.name %>",
email: "<%= other.email %>",
photoUrl: "<%= other.photo_url %>",
welcomeMessage: "Hey, how can I help?"
});
var conversation = talkSession.getOrCreateConversation(Talk.oneOnOneId(me, other));
conversation.setParticipant(me);
conversation.setParticipant(other);
var chatbox = talkSession.createChatbox();
chatbox.select(conversation);
chatbox.mount(document.getElementById("talkjs-container"));
});