You are reading a single comment by @navas and its replies. Click here to read the full conversation.
  • I tried downloading the Pusher.js from GitHub and put it in the sandbox directory, then I uploaded the code from right-hand side of the IDE, but still getting following error,

    Uncaught ReferenceError: "Pusher" is not defined
    at line 1 col 5
    new Pusher(PUSHER_KEY, {}, function(pusher) {

    Can anyone help?

    require("Pusher");
    var PUSHER_KEY = 'XXXXXXXXXXXXX';
    new Pusher(PUSHER_KEY, {}, function(pusher) {
      var testChannel = pusher.subscribe('test_channel');
      testChannel.bind('my_event', function(data) {
        console.log('Got a message:', data);
      });
    });
    
About

Avatar for navas @navas started