Welcome to ExPusherLite!


This is a minimal Pusher.com clone made in Elixir intended to be used as the real-time communications component for web applications built in any language that are in need for Web Sockets support.

After you sign up and create a new Application, you can create an authentication token from the server side like this (Ruby example):

      
      uri = URI.parse("https://expusherlite.cm42.io/api/sessions")
      response = Net::HTTP.post_form(uri, {"token" => "your secret user token"})
      @guardian_token = JSON.parse(response.body)["jwt"]
      
    

You can cache the JWT for up to 2 days. Now you can pass it to your application's client-side Javascript like this:

      
      // in the HTML don't forget to import the required JS
      // <script src="https://expusherlite.cm42.io/js/pusher.js"></script>

      var PusherLite = require("pusher_lite").default;

      var pusher = new PusherLite("your new application public key", {
        jwt: "JWT session created through the /api/sessions API above",
        uniqueUserId: "unique identifier for your user",
        ssl: true})

      var publicChannel = pusher.subscribe("general"); // any topic name

      publicChannel.bind("new_message", function(payload) {
        console.log(payload.name);
        console.log(payload.message);
      })

      pusher.joinAll(); // you can subscribe to any number of channels, bind events, and join all at once

      // send message to the channel
      publicChannel.trigger("new_message", { "name" : "John", "message" : "Hello" });
      
    

Sign Up Now!