Modern XMPP in the browser, with a JSON API
Modern XMPP in the browser, with a JSON API.
Stanza.io 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 stanza.io.
v4.0.0, stanza.io is using the protocol specified in RFC 7395 by default, which contains backwards incompatible changes.
Servers have started switching to using the RFC version of the WebSocket binding; notably, Prosody's WebSocket module for
prosody-0.10. If your server has not yet been upgraded, you can set
['old-websocket'] in the config:
var oldws = XMPP;
v7.3.0, the XML/JSON mapping definitions have been split out into the jxt-xmpp module to allow their use outside of stanza.io itself.
$ npm install stanza.io
npm install to get all of the dependencies, and then run
$ npm install$ make
The bundled and minified files will be in the generated
npm installin the
demo.htmlin your browser.
var XMPP = ; // if using browserifyvar client = XMPP;client;client;client;
If you like this, follow @lancestout on twitter.