// in the browser...
const client = io(clientCredentials);
// Send messages to the "greeting" topic
client.emit('greeting', 'Oh, hi there!', () => {
console.log('message sent!');
});
// in the browser...
const client = io(clientCredentials);
// Listen for messages on the "greeting" topic
client.on('greeting', message => {
console.log('message received:', message);
});