Kwwika ceased operation on 01/06/2011. Please migrate to Pusher

API‎ > ‎JavaScript‎ > ‎How to...‎ > ‎

Publish data

To publish data into the Kwwika service you first need to establish a connection and then call the publish method on the connection object.
var connection = kwwika.Service.connect({ apiKey: "YOUR_API_KEY" });
connection.publish("/KWWIKA/EXAMPLES/CHAT",
            { name: "Kwwika", text: "Hello, world!" },
            {
                commandSuccess: function(sTopicName)
                {
                    // handle success
                },
                commandError: function(sTopicName, sReason)
                {
                    // handle error
                }
            });