Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stanza

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stanza

Modern XMPP in the browser, with a JSON API

  • 11.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.9K
increased by20.75%
Maintainers
1
Weekly downloads
 
Created
Source

Stanza

Modern XMPP in the browser, with a JSON API.


What is this?

Stanza 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.

Installing

$ npm install stanza

Getting Started

  1. Find or install a server which supports XMPP over WebSocket (Prosody recommended).
  2. Clone this repo with git clone https://github.com/legastero/stanza.io.git
  3. Run npm install in the new stanza.io directory.
  4. Run npm run build to create dist/stanzaio.browser.js.
  5. Open demo.html in your browser.
  6. Enter your connection info, click connect.
  7. Use the JS console to play with the XMPP client (var client).

Echo Client Demo

var XMPP = require('stanza');

var client = XMPP.createClient({
    jid: 'echobot@example.com',
    password: 'hunter2',

    // If you have a .well-known/host-meta.json file for your
    // domain, the connection transport config can be skipped.

    transport: 'websocket',
    wsURL: 'wss://example.com:5281/xmpp-websocket'
    // (or `boshURL` if using 'bosh' as the transport)
});

client.on('session:started', function() {
    client.getRoster();
    client.sendPresence();
});

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

client.connect();

Documentation

Discussion

MUC Room: discuss@stanzajs.org / Logs

License

MIT

Created By

If you like this, follow @lancestout on twitter.

Keywords

FAQs

Package last updated on 21 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc