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

  • 12.17.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.3K
decreased by-6.57%
Maintainers
1
Weekly downloads
 
Created
Source

StanzaJS

Modern XMPP, with a JSON API.


npm chat

What is this?

StanzaJS is a JavaScript/TypeScript library for using modern XMPP, 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 StanzaJS.

Installing

npm install stanza

Echo Client Demo

import * as XMPP from 'stanza';

const 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.
    transports: {
        websocket: 'wss://example.com:5281/xmpp-websocket',
        bosh: 'https://example.com:5281/http-bind'
    }
});

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

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

client.connect();

Documentation

Discussion

MUC Room: discuss@stanzajs.org / Logs

These are related modules that form part of StanzaJS:

NameDescriptionSource
stanza-shimsRuntime shims used by StanzaJS for node, browsers, and React Native.Source

These are some additional modules that are highly recommended for use with StanzaJS:

NameDescriptionSource
staydownRender helper that keeps an element scrolled to the bottom based on user intent.Source
webrtc-adapterShims browsers to provide a consistent WebRTC API.Source

License

MIT

Portions of StanzaJS are derived from prior works. See NOTICE file for details.

Created By

If you like this, follow @lancestout on Twitter.

Keywords

FAQs

Package last updated on 05 May 2021

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