Creating direct messaging with Twilio Programmable Chat

The way to create a 1:1 user to user direct messaging is to create a private Channel with the 2 Users added as Members. You can create private channels by specifying 'isPrivate' property during channel creation.

Sample:

// Create a Channel
messagingClient.createChannel({
uniqueName: 'general',
friendlyName: 'General Chat Channel',
isPrivate: true
}).then(function(channel) {
console.log('Created general channel:');
console.log(channel);
});

For more information, see our documentation on channels and channel options.

Have more questions? Submit a request
Powered by Zendesk