Invite a user to a private chat room

The chat.invite() method allows you to invite other users to a private chat room.

let adam = new ChatEngine.user('adam-UUID');
privateChat.invite(adam);

Listen to $.invite Event

An $.invite event is emitted on the invited user’s direct chat when they are invited to a private chat room. The user can listen to these events or retrieve them later by using chat.search() on their direct chat channel.

me.direct.on('$.invite', (payload) => {
    let invitedChat = new ChatEngine.Chat(payload.data.channel);
});