Create a Channel
To create a new channel using the SDK, you need to create at least 2 Participant
instances with the participant user IDs and pass them as an array to either to createDirectMessageChannel()
or createGroupMessageChannel()
function depending on the number of participants you have.
Let’s initialise two participants and create a direct message channel.
Substitute the user IDs with your own user IDs here.
Now, call the function:
Run your project and now you should see a New channel created message in your console log along with the ID of the newly created channel.
Note down the ID because we’ll use it to send and receive some messages
Last updated