Looks like there could be two ways to do this:
1. Use Twilio webhooks:
https://www.twilio.com/docs/chat/webhook-events
You'll need to register the webhook in your chat channel for the event you want to listen to and tell it what endpoint to send the request to, then you can handle the request in your server's REST API. This lets you send all updates directly to your server straight form Twilio
Alternatively,
2. Use a ChannelListener in your javascript
New message in the channel:
// Listen for new messages sent to a channel
myChannel.on('messageAdded', function(message) {
console.log(message.author, message.body);
});
Channel updated:
// A channel's attributes or metadata have changed.
chatClient.on('channelUpdated', function(channel) {
console.log('Channel updates: ' + channel.sid);
});