SkillAgentSearch skills...

Stanza

Modern XMPP, with a JSON API

Install / Use

/learn @legastero/Stanza
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

StanzaJS

Modern XMPP, with a JSON API.

<hr /> <p> <a href="https://npmjs.org/package/stanza"><img src="https://img.shields.io/npm/v/stanza.svg?style=flat" alt="npm" /></a> <a href="https://stanzajs.org/discuss/logs/"><img src="https://img.shields.io/badge/endpoint.svg?url=https://stanzajs.org/discuss/badge.json&style=flat" alt="chat" /></a> </p>

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

Recommended Modules

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

| Name | Description | Source | | ---------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------ | | staydown | Render helper that keeps an element scrolled to the bottom based on user intent. | Source | | webrtc-adapter | Shims 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.

Related Skills

View on GitHub
GitHub Stars1.2k
CategoryDevelopment
Updated4d ago
Forks252

Languages

TypeScript

Security Score

100/100

Audited on Mar 28, 2026

No findings