Matrix Logo

Matrix.org is "an open standard for decentralized persistent communication". This module is being developed to connect Drupal sites to Matrix chat rooms. It is in its very early stages but a wide range of functionality is on the roadmap to develop. Currently it can post to Matrix, but does not support reading from a Matrix room,and version 3 (in developmen) supports reading from a Matrix room. End-to-End encryption is not (yet) supported.

If you are a Matrix user and interested in working with us, please get in touch!

Roadmap

  1. Basic message posting API -- post an event to a Matrix room Done
  2. Basic state posting API -- post a State event to a Matrix room Done
  3. Rules Integration -- send events to Matrix from Rules Done
  4. ECA Integration -- send events to Matrix from ECA Done
  5. Authentication Token generation -- Generate a token from a username/pw Done
  6. Embedded Chat -- embed a Matrix chat room in a web page, using matrix-react-sdk
  7. Authentication Provider -- provide some sort of single-sign-on facility to allow a private Matrix homeserver to accept a Drupal login, and auto-provision account - in development at matrix_api_identity
  8. Application Server -- create an endpoint in Drupal that receives Matrix events - in development at matrix_api_application_server
  9. Matrix HS management -- Create a Matrix Application Server that can manage rooms, users from a Drupal module - in development at matrix_api_application_server

Features (v3)

Provides the foundational plumbing for Matrix integration in Drupal:

  • MatrixClient service for making authenticated calls to a Matrix homeserver (/sync, sendMessage, sendThreadReply, setRoomState, etc.)
  • ECA actions: Send Message, Send Thread Reply, Redact Event, Set Room State, Trigger Poll
  • ECA event plugin: fires on inbound Matrix events so ECA models can react without custom code
  • Rules action for sending messages (when Rules is installed)
  • CronPoller — on each Drupal cron run, calls /sync and dispatches any new events as Symfony events that other modules can subscribe to. Supports deduplication and self-sender filtering so the bot does not react to its own messages.
  • Drush daemon command for near-real-time polling (long-poll mode) outside of cron

Post-Installation (v3)

Go to Admin → Configuration → Services → Matrix API Settings and enter your homeserver URL, bot username, and access token. Optionally set a default room and enable cron polling.

If you use ECA, Matrix actions and the "Matrix: Event Received" event will appear automatically in your ECA model builder.

Additional requirements (v3)

Drupal 11.2 or later. A Matrix homeserver account with a bot user and access token. Optional: ECA for no-code automation; Rules for rules-based automation.

Version 2 only supports Drupal -> Matrix publishing, and works with older Drupal versions.

Recommended modules

Supporting organizations: 
Sponsored development

Project information

Releases