Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/legastero/stanza
Modern XMPP, with a JSON API
https://github.com/legastero/stanza
jingle jxt stanza xmpp
Last synced: 22 days ago
JSON representation
Modern XMPP, with a JSON API
- Host: GitHub
- URL: https://github.com/legastero/stanza
- Owner: legastero
- License: mit
- Created: 2012-10-30T00:03:12.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T16:14:30.000Z (5 months ago)
- Last Synced: 2024-10-11T11:30:41.964Z (28 days ago)
- Topics: jingle, jxt, stanza, xmpp
- Language: TypeScript
- Homepage:
- Size: 5.12 MB
- Stars: 1,224
- Watchers: 64
- Forks: 250
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Support: docs/Supported_XEP_Formats.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-starred - legastero/stanza - Modern XMPP, with a JSON API (others)
README
# StanzaJS
**Modern XMPP, with a JSON API.**
## 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
```sh
npm install stanza
```## Echo Client Demo
```javascript
import * as XMPP from 'stanza';const client = XMPP.createClient({
jid: '[email protected]',
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
- [Configuring](docs/Configuring.md)
- [Events](docs/Events.md)
- [Client Methods](docs/Reference.md)
- [JXT: JSON/XML Translation](docs/jxt/README.md)
- [Working with Languages](docs/jxt/Language.md)
- [Field Definition Types](docs/jxt/FieldTypes.md)
- [Supported XEP Formats](docs/Supported_XEP_Formats.md)
- [Creating Plugins](docs/Create_Plugin.md)
- [Using with React Native](docs/React_Native.md)
- [Using PubSub](docs/Using_PubSub.md)
- [Using Stream Management](docs/Using_Stream_Management.md)## Discussion
MUC Room: [[email protected]](https://stanzajs.org/discuss/logs) / [Logs](https://stanzajs.org/discuss/logs)
## Recommended Modules
These are some additional modules that are highly recommended for use with StanzaJS:
| Name | Description | Source |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------ |
| [staydown](https://npmjs.org/package/staydown) | Render helper that keeps an element scrolled to the bottom based on user intent. | [Source](https://github.com/fritzy/staydown) |
| [webrtc-adapter](https://npmjs.org/package/webrtc-adapter) | Shims browsers to provide a consistent WebRTC API. | [Source](https://github.com/webrtchacks/adapter) |## License
[MIT](./LICENSE.md)
Portions of StanzaJS are derived from prior works. [See NOTICE file for details.](./NOTICE.md)
## Created By
If you like this, follow [@lancestout](http://twitter.com/lancestout) on Twitter.