Skip to main content

Matrix

In order for this badge to work, the host of your room must allow guest accounts or dummy accounts to register, and the room must be world readable (chat history visible to anyone).

Alternatively access via the experimental summary endpoint (MSC3266) can be configured with the query parameter fetchMode for less server load and better performance, if supported by the homeserver
For the matrix.org homeserver fetchMode is hard-coded to summary.

The following steps will show you how to setup the badge URL using the Element Matrix client.

  • Select the desired room inside the Element client
  • Click on the room settings button (gear icon) located near the top right of the client
  • Scroll to the very bottom of the settings page and look under the Addresses section
  • You should see one or more room addresses (or aliases), which can be easily identified with their starting hash (#) character (ex: #twim:matrix.org)
  • If there is no address for this room, add one under Local addresses for this room
  • Remove the starting hash character (#)
  • The final badge URL should look something like this /matrix/twim:matrix.org.svg

Some Matrix homeservers don't hold a server name matching where they live (e.g. if the homeserver example.com that created the room alias #mysuperroom:example.com lives at matrix.example.com).

If that is the case of the homeserver that created the room alias used for generating the badge, you will need to add the server's FQDN (fully qualified domain name) as a query parameter.

The final badge URL should then look something like this /matrix/mysuperroom:example.com.svg?server_fqdn=matrix.example.com.

Path Parameters
roomAlias string REQUIRED

Example: twim:matrix.org

Query Parameters
server_fqdn string

Example: matrix.org

fetchMode string

Possible values: [guest, summary]

guest configures guest authentication while summary configures usage of the experimental "summary" endpoint (MSC3266). If not specified, the default fetch mode is guest (except for matrix.org).

Example: guest

style string

Possible values: [flat, flat-square, plastic, for-the-badge, social]

Если не указано, стиль по умолчанию для этого значка будет "flat".

Example: flat

logo string

Иконка из simple-icons. Вы можете щелкнуть по названию иконки на simple-icons, чтобы скопировать slug, или они могут быть найдены в файле slugs.md в репозитории simple-icons. Дополнительная информация.

Example: appveyor

logoColor string

Цвет логотипа (hex, rgb, rgba, hsl, hsla и css-названия цветов поддерживаются). Поддерживается для логотипов simple-icons, но не для кастомных логотипов.

Example: violet

logoSize string

Настройте адаптивный размер иконок, установив значение auto. Это полезно для более широких логотипов, таких как amd и amg. Поддерживается для логотипов simple-icons, но не для кастомных логотипов.

Example: auto

label string

Переопределите текст на левой части значка (URL-encoded для пробелов или специальных символов!).

Example: healthiness

labelColor string

Цвет фона левой части (поддерживаются hex, rgb, rgba, hsl, hsla и css-названия цветов).

Example: abcdef

color string

Цвет фона правой части (поддерживаются hex, rgb, rgba, hsl, hsla и css-названия цветов).

Example: fedcba

cacheSeconds string

Время жизни HTTP-кэша (правила применяются для вычисления значения по умолчанию для каждого значка, любые указанные значения, ниже значения по умолчанию, будут игнорироваться).

Example: 3600

link string[]

Укажите, что должно происходить при клике на левую/правую часть значка. Обратите внимание, что это работает только при интеграции значка в тег HTML <object>, но не в тег <img> или разметку.