This project is not covered by Drupal’s security advisory policy.

Drupal's Matrix API module connects to a Matrix homeserver as a regular bot user — joining rooms, sending messages, and polling for new events. That works well for many use cases, but a bot user has inherent limits: it must be invited to each room individually, it can only see events in rooms it has joined, and it cannot act as or create other Matrix users.

This module lifts those limits by implementing the Matrix Application Service protocol. An Application Service (AS) is registered directly with the homeserver and receives a push of every event — across all rooms, all users, and all event types — without joining anything. It can also create and manage a namespace of virtual Matrix users that appear to the rest of the network as real accounts on the homeserver.

Features

  • Exposes the AS /_matrix/app/v1/transactions endpoint so the homeserver can push event batches to Drupal in real time — no polling required
  • Manages the hs_token / as_token credential handshake that authenticates traffic between the homeserver and Drupal in both directions
  • Generates the Application Service registration YAML that your homeserver operator adds to homeserver.yaml (Synapse) or equivalent
  • Enables virtual user provisioning: Drupal can create Matrix users on behalf of site accounts, so each Drupal user can have a corresponding Matrix identity rather than all messages appearing to come from a single bot
  • Handles the AS namespace configuration (user namespace, room namespace, alias namespace) so only the events relevant to your integration are pushed
  • Suitable for bridge-style integrations, multi-room monitoring, and large deployments where inviting a bot to every room is not practical

Post-Installation

After enabling the module, go to Admin → Configuration → Services → Matrix Application Server to configure your user and room namespaces and generate the registration file. Provide that YAML file to whoever administers your Matrix homeserver — it must be added to the server configuration and the homeserver restarted before events will flow. Once registered, inbound events arrive at Drupal in real time rather than on a cron schedule. YAML file is formatted and tested with a Matrix Synapse homeserver - other homeservers may require different configurations.

Additional Requirements

matrix_api. Administrative access to your Matrix homeserver is required to register the Application Service — this is a server-side configuration step that cannot be done from within Drupal alone. Self-hosted Synapse, Conduit, Dendrite, and most other homeserver implementations support the Application Service protocol.

- matrix_api_identity — map virtual Matrix users to Drupal accounts
- matrix_api_entity — sync Drupal content entities with Matrix room threads

Project information

Releases