Modern XMPP in the browser, with a JSON API

npm install
1 downloads in the last day
192 downloads in the last week
728 downloads in the last month

Modern XMPP in the browser, with a JSON API.

Build Status Dependency Status devDependency Status

Browser Support

What is this? is a library for using modern XMPP in the browser, and it does that by exposing everything as JSON. Unless you insist, you have no need to ever see or touch any XML when using

Important Protocol Changes

Starting with v4.0.0, is using the protocol specified in the latest XMPP over WebSocket draft, which contains backwards incompatible changes.

Servers have started switching to using the latest protocol; notably, Prosody's WebSocket module. If your server has not yet been upgraded, you will need to use a 3.x version of


$ npm install

Building bundled/minified version (for AMD, etc)

$ grunt

The bundled and minified files will be in the generated build directory.

Getting Started

  1. Find or install a server which supports XMPP over WebSocket (Prosody recommended).
  2. Run grunt to build build/stanzaio.bundle.js
  3. Open demo.html in your browser
  4. Enter your connection info, click connect.
  5. Use the JS console to play with the XMPP client (var client).

If you want to see in action in a full-featured client, take a look at (and its source).

Echo Client Demo

var XMPP = require(''); // if using browserify

var client = XMPP.createClient({
    jid: '',
    password: 'hunter2'

client.on('session:started', function () {

client.on('chat', function (msg) {
      to: msg.from,
      body: 'You sent: ' + msg.body




Created By

If you like this, follow @lancestout on twitter.

npm loves you