It worked for me by using the sinch-rtc
as Savaj Patel mentioned.
Example:
sinchClient = new SinchClient({
applicationKey: 'YOUR KEY',
capabilities: {messaging: true},
onLogMessage: function(message) {
console.log(message);
}
});
sinchClient.start(CREDENTIALS).then(function() {
console.log('Success!');
})