xmpp.js is a free, open source browsers & extensions project written in JavaScript and released under ISC. It has 2,279 GitHub stars, 383 forks and 35 open issues, and was last pushed 1 months ago. On this registry it ranks #102 of 141 tracked projects in Browsers & Extensions, with 5 head-to-head comparisons available.

What is xmpp.js?

xmpp.js is a modular JavaScript library that lets developers build XMPP chat, presence, and real-time messaging clients or components for browsers, Node.js, React Native, and other JavaScript runtimes.

What it is

xmpp.js is a set of JavaScript packages for the Extensible Messaging and Presence Protocol (XMPP), the open standard for instant messaging, presence, multi-party chat, voice and video calls, and general routing of XML data. It is split into focused packages — including client, component, xml, jid, time, and uri — so each feature, including core XMPP features, is a module that can be added or removed as needed.

The project solves the practical problem of speaking XMPP reliably from JavaScript without hand-rolling protocol handling, transport selection, or failure recovery. By default it handles errors and reconnects automatically, and with appropriate configuration it can loop through a list of endpoints, so a developer does not have to write a single line of code to deal with network failures. It replaces the need to build an XMPP stack from scratch when targeting JavaScript environments, and releases follow the Semantic Versioning specification.

Key capabilities

  • Runs everywhere JavaScript runs, using the best network transport available, including browsers, Node.js, WebWorker, React Native, Bun, Deno, GJS, and Duktape.
  • Provides a default client package that does not exceed 13 kb gzipped for the web, achieved by avoiding third-party dependencies.
  • Implements XMPP Core per RFC 6120 through @xmpp/client-core and @xmpp/component-core, included in @xmpp/client and @xmpp/component.
  • Supports Transport Layer Security per RFC 7590 via @xmpp/tls, included in @xmpp/client.
  • Handles the XMPP address format per RFC 7622 via @xmpp/jid, included in both @xmpp/client and @xmpp/component.
  • Speaks the XMPP-over-WebSocket subprotocol per RFC 7395 through @xmpp/websocket, and session establishment per draft-cridland-xmpp-session-01 through @xmpp/session-establishment.
  • Reconnects automatically on errors and can iterate a configured list of endpoints, alongside modular packages for XML, JID, time, and URI handling.

Who uses it and how

  • Products built on it include Snikket, Fluux Messenger, xmpp-web, Mustang, Wobbly, and WorkAdventure, spanning hosted chat services and self-hosted web clients.
  • Infrastructure and IoT deployments use it, such as openHAB, MeshCentral, Telldus, and the Logitech Harmony Hub library, where XMPP carries device and automation traffic.
  • Organizations integrate it into existing platforms, for example Alcatel-Lucent Rainbow, ConnectyCube, Crypho, and Sockethub.
  • Bridges and bots are built on it, including matrix-bifrost, the WordPress Telegram Bot, gx-twilio (a bridge between Twilio SMS and XMPP), and the FACEIT Chatbot Service.

Getting started

Install the packages from npm — start with @xmpp/client for a client, or @xmpp/component for a component — and consult the client, component, xml, jid, time, and uri package directories for usage. Community support is available through the project's GitHub Discussions section.

How it compares

xmpp.js stands alone in this registry as a JavaScript implementation of XMPP; the repository does not name a specific competing library to compare it against.

When to use it — and when not to

It suits projects that need XMPP in a JavaScript environment, from browser clients to Node.js services, and it carries little dependency burden since the default client stays under 13 kb gzipped. A self-hoster still needs a separate XMPP server and its own configuration for TLS, storage, and any other server-side concerns, since xmpp.js is a client and component library rather than a server. Note that 35 issues are open and the README is largely a package and protocol index rather than a tutorial, so expect to read the individual package documentation when adopting it.

project readme (upstream, from github) — read inline

xmpp.js

XMPP is the Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data.

xmpp.org/about-xmpp/technology-overview/

xmpp.js is a JavaScript library for XMPP.

Get started

goals

universal

Runs everywhere JavaScript runs and makes use of the best network transport available.

xmpp.js is known to be used with browsers, Node.js, WebWorker, React Native, Bun, Deno, GJS and Duktape.

reliable

By default, it handles errors and will automatically reconnect. With appropriate configuration it will even loop through a list of endpoints. You don't have to write a single line of code to handle network failures.

Releases follow the Semantic Versioning specification

modular

Each feature is implemented as a module that can be added or removed easily. Including core XMPP features.

small

We avoid third party dependencies.

For the web, we make the sure the default client doesn't exceed 13 kb (gzipped), for reference, that's less than half the size of React.

Getting help

Do you need help with working with xmpp.js? Please reach out to our community by posting in the Discussions section of this project.

Built with xmpp.js

Feel free to send a PR to add your project or organization to this list.

Protocols

RFC 6120 - Extensible Messaging and Presence Protocol (XMPP): Core

See @xmpp/client-core and @xmpp/component-core

Included in @xmpp/client and @xmpp/component


RFC 7590 - Use of Transport Layer Security (TLS) in the Extensible Messaging and Presence Protocol (XMPP)

See @xmpp/tls

Included in @xmpp/client


RFC 7622 - Extensible Messaging and Presence Protocol (XMPP): Address Format

See @xmpp/jid

Included in @xmpp/client and @xmpp/component


RFC 7395 - An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket

See @xmpp/websocket

Included in @xmpp/client


draft-cridland-xmpp-session-01 Here Lies Extensible Messaging and Presence Protocol (XMPP) Session Establishment

See @xmpp/session-establishment


XEP-0368: SRV records for XMPP over TLS

See @xmpp/resolve

Included in @xmpp/client


XEP-0156: Discovering Alternative XMPP Connection Methods

See @xmpp/resolve

Included in @xmpp/client


XEP-0114: Jabber Component Protocol

See @xmpp/component-core

Included in @xmpp/component


XEP-0082: XMPP Date and Time Profiles

See @xmpp/time


XEP-0198: Stream Management

See @xmpp/stream-management

Included in @xmpp/client


XEP-0388: Extensible SASL Profile

See @xmpp/sasl2

Included in @xmpp/client


XEP-0386: Bind 2

See @xmpp/client-core

Included in @xmpp/client


XEP-0484: Fast Authentication Streamlining Tokens

See @xmpp/client-core

Included in @xmpp/client

credits

xmpp.js is a rewrite of node-xmpp and learned a lot from it.

Thanks to all xmpp.js and node-xmpp contributors.

Frequently asked questions

Is xmpp.js free to use?

xmpp.js is open source under the ISC licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does xmpp.js do?

XMPP for JavaScript

What is xmpp.js written in?

xmpp.js is primarily written in JavaScript. Its source is publicly available at https://github.com/xmppjs/xmpp.js, and it has 2,279 GitHub stars.