Stanza
Modern XMPP, with a JSON API
Install / Use
/learn @legastero/StanzaREADME
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
- API Reference
- JXT: JSON/XML Translation
- Supported XEP Formats
- Creating Plugins
- Using with React Native
- Using PubSub
- Using Stream Management
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
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
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
