Configuration options

When creating a new PushJS, you can give optional parameters as a configuration object.

  • ready: pass a callback function which will be executed as soon as PushJS is fully loaded
  • host: pushjs server location host
  • port: pushjs server location port

Server locations

  • Europe: eu-1.pushjs.io:9101
  • Canada: ca-1.pushjs.io:9101
The default is eu-1.pushjs.io:9101 when no host or port is set.

An example of a fully configured PushJS

                    
<script>

    window.onload = function() {

        PushJS.init({
            readyListener: onReadyListener,
            host: 'ca-1.pushjs.io',
            port: 9101
        });
    };

    function onReadyListener() {
        console.log('Hello! Welcome to PushJS');
    }

</script>