# Chat room invitation event
You can invite to this event by creating an event to invite to a new chat room or chat room.
If you are not ready, let's learn how to create it. Go to preparations
# Chat room invitation event
channel.sendInvite({
        roomId: "Room ID to invite",
        clientKey: "The client key you want to invite",
    },
    function (err, res) {
        console.log(res)
    }
);
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
- Parameter value - Value - Identifier - Description - err - String - Object returned in case of error - res - String - Object returned on success 
# code to apply to the project
channel.sendInvite({
        roomId: "Room ID to invite",
        clientKey: "The client key you want to invite",
    },
    function (err, res) {
        if (res) {
            console.log('invitation success')
        } else if (err) {
            console.log('invitation failed', err)
        }
    }
);
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
← leave chat User type →