packages/docs/connectors/matrix.md
Connect your agent to Matrix for federated chat across rooms and spaces using the @elizaos/plugin-matrix package.
| Name | Required | Description |
|---|---|---|
MATRIX_ACCESS_TOKEN | Yes | Access token for authenticating with the homeserver |
MATRIX_HOMESERVER | No | Homeserver URL (e.g., https://matrix.org) |
MATRIX_USER_ID | No | Bot user identifier (e.g., @bot:matrix.org) |
MATRIX_DEVICE_ID | No | Device identifier for encryption sessions |
MATRIX_ROOMS | No | Comma-separated list of room IDs to join |
MATRIX_AUTO_JOIN | No | Automatically join rooms when invited |
MATRIX_ENCRYPTION | No | Enable end-to-end encryption |
MATRIX_REQUIRE_MENTION | No | Only respond when the bot is @mentioned |
The connector auto-enables when token, botToken, or apiKey is truthy in the connector config. Set the access token in both places:
{
"env": {
"MATRIX_ACCESS_TOKEN": "syt_your_access_token"
},
"connectors": {
"matrix": {
"token": "syt_your_access_token"
}
}
}
To explicitly disable the connector even when a token is present:
{
"connectors": {
"matrix": {
"enabled": false
}
}
}
env.MATRIX_ACCESS_TOKEN.