converse.js
repository·master·Indexed 25 days ago
https://github.com/conversejs/converse.jsA modern, feature-rich, 100% client-side XMPP chat application that runs in a web browser. It supports rich messaging, OMEMO end-to-end encryption, and file sharing via HTTP File Upload. Converse.js can be deployed as a standalone web app or integrated into websites using Fullpage, Overlay, or Embedded display modes. It includes a plugin architecture based on pluggable.js and provides a headless build (@converse/headless) for developers wishing to build custom user interfaces on top of the Converse XMPP engine.
What's inside converse.js
- Texture is Converse's specialized library designed to transform plain text into rich multimedia content. It provides a suite of web components specifically built for rendering various types of media within the Converse ecosystem.
Overview of converse-omemo plugin
masterThe
converse-omemoplugin provides an implementation of XEP-0384 OMEMO end-to-end encryption (version 0.3.0) for use with Converse.js.Important Note: This package only implements the headless (non-UI) logic. To use OMEMO with a user interface, you must also include the
converse-omemo-viewsplugin to handle the UI components.Overview of Converse.js Display Modes
masterConverse.js can be integrated into websites using three distinct display modes depending on your UI requirements:
- Fullpage: The default mode where Converse functions as a single-page application (SPA) covering the entire browser viewport.
- Overlay: The chat interface appears as an overlay/chat box on top of your existing website content.
- Embedded: The chat interface is integrated directly into specific elements within your page's DOM.
Converse.js Key Features
masterConverse.js is a 100% client-side XMPP chat application with the following capabilities:
- Rich Messaging: Supports message styling, corrections, reactions, and URL previews.
- Privacy: End-to-end encryption via OMEMO.
- File Sharing: Supports HTTP File Upload.
- Notifications: Desktop notifications for incoming messages.
- Extensibility: Uses a plugin architecture based on
pluggable.js. - User Features: Custom status messages, availability indicators, and anonymous login (if supported by the server).
- Internationalization: Supports over 40 languages.
- Responsiveness: Optimized for both desktop and mobile devices.
Quickstart: Use Converse via CDN
masterThe fastest way to add Converse to your project is by including the CSS and JavaScript files from the official CDN in your HTML
<head>. You can use the latest version or pin to a specific version like14.0.0for stability.<!-- Latest version --> <link rel="stylesheet" href="https://cdn.conversejs.org/dist/converse.min.css"> <script type="module" src="https://cdn.conversejs.org/dist/converse.min.js"></script> <!-- Pin to specific version --> <link rel="stylesheet" href="https://cdn.conversejs.org/14.0.0/dist/converse.min.css"> <script type="module" src="https://cdn.conversejs.org/14.0.0/dist/converse.min.js"></script>Quickstart: Self-host Converse files
masterTo host Converse yourself, download the latest release archive and extract the
dist/folder to your web server.Important: Converse loads additional assets dynamically from the
dist/directory. If your assets are not located in the default path, you must configure theassets_pathoption during initialization.Use Live Reloading with RSPack devserver
masterFor a development experience that includes automatic browser refreshes, use the RSPack development server instead of the standard watch mode.
Run either:
make devserveror
npm run devserverThen visit
http://localhost:8080in your browser.Enable OMEMO encryption support
masterTo develop with OMEMO end-to-end encryption support, you must manually load
libsignal-protocol-javascriptin your HTML page. This is required because of its GPLv3 license.Add the following script tag to your page:
<script src="3rdparty/libsignal-protocol-javascript/dist/libsignal-protocol.js"></script>Set up a Converse development environment
masterTo begin developing or customizing Converse, clone the repository and install dependencies using NPM. It is recommended to use NVM to manage Node.js versions.
After cloning, run the following commands to start the development environment:
- Install dependencies:
npm install - Start the server in the background:
npm run serve &(ormake serve_bg) - Start the watcher:
npm run watch(ormake watch)
Once running, access the development interface at
http://localhost:8000/dev.html.git clone https://github.com/conversejs/converse.js.git cd converse.js npm install npm run serve & npm run watch- Install dependencies:
Initialize Converse in a Web Component Shadow DOM
masterWhen using Converse inside a web component's shadow DOM, you must set the
rootconfiguration option to the shadow-root of that DOM to ensure correct rendering.class CustomChatComponent extends HTMLElement { constructor() { super(); const shadowRoot = this.attachShadow({ mode: 'open' }); this.initConverse(shadowRoot); } initConverse(shadowRoot) { window.addEventListener('converse-loaded', function (event) { const { converse } = event.detail; converse.initialize({ root: shadowRoot, // Other settings go here... }); }); } }Build for CDN deployment
masterTo create a build suitable for CDN deployment that uses absolute paths, run:
npm run cdnUse Converse integration and display modes
masterConverse can be integrated into your web application in three ways:
- Standalone page: Run Converse as its own dedicated page.
- Floating overlay: Run Converse as a floating UI element over your existing content.
- Embedded mode: Embed the chat interface directly inside a specific
<div>on your page.
You can also trigger specific chat views using URL fragments, such as
#converse/chat?jid=user@domainto open a direct chat with a specific JID.