Global configuration

Global configuration has been deprecated since version 2.1 and will be removed in the next major release.
In newer versions of pusher-js, please use constructor options.

Pusher.host (String)

This can be changed to point to alternative Pusher URLs (used internally for our staging server or if you’d like to try out beta features).

Pusher.channel_auth_endpoint (String)

Endpoint on your server that will return the authentication signature needed for private and presence channels. Defaults to '/pusher/auth'.

For more information see authenticating users.

Note: If authentication fails a subscription_error event is triggered on the channel. For more information see handling authentication problems.

Pusher.channel_auth_transport (String)

Defines how the authentication endpoint, defined using Pusher.channel_auth_endpoint, will be called. There are two options available:

  • ajax - The default option where an XMLHttpRequest object will be used to make a request. The parameters will be passed as POST parameters.
  • jsonp - The authentication endpoint will be called by a <script> tag being dynamically created pointing to the endpoint defined by Pusher.channel_auth_endpoint. This can be used when the authentication endpoint is on a different domain to the web application. The endpoint will therefore be requested as a GET and parameters passed in the query string.

For more information see the Channel authentication transport section of the authenticating users docs.

Pusher.log (Function)

By default we don’t log anything. If you want to debug your application and see what’s going on within Pusher then you can assign a global logging function.

The Pusher.log value should be set with a function with the following signature:

function(msg) {
}

Example

Pusher.log = function(message) {
  if (window.console &amp;&amp; window.console.log) window.console.log(message);
};

Have you tried using the search to find what you’re after? If you still have a question then get in touch with us and let us help you out.