The snippet below connects to channels and subscribes to a channel :-

Console

npm install pusher-js