You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Leonie 1c7a4aaeaa Patch 21/05/2019 10 months ago
.buildkite consistent capitalisation in buildkite pipelines 11 months ago
.github Update issue templates 10 months ago
docs add description of new labs feature for message editing 10 months ago
electron_app v1.1.2 10 months ago
origin_migrator Add tool to migrate logins between origins 1 year ago
res Patch 21/05/2019 10 months ago
scripts remove emojione 10 months ago
src Patch 21/05/2019 10 months ago
test Setup crypto store for restore session tests 1 year ago
.babelrc Fix .babelrc to be the same as react-sdk 11 months ago
.dockerignore Ignore a bunch of files in the docker build to reduce context size 11 months ago
.editorconfig add .editorconfig 3 years ago
.eslintignore Don't lint the autogenned file 3 years ago
.eslintrc.js Add eslint config 3 years ago
.gitignore Remove karma junit output 11 months ago
.modernizr.json oops, rebuild modernizr to pull in new tests 2 years ago
.npmignore Don't include the world in the published packages 3 years ago
AUTHORS.rst Fixes #1953 2 years ago Prepare changelog for v1.1.2 10 months ago
CONTRIBUTING.rst Link to CONTRIBUTING from JS SDK 1 year ago
Dockerfile Increase timeout for yarn install in Docker builds 10 months ago
LICENSE Basic structure of a react SDK and start of an implementation. 4 years ago Patch 21/05/2019 10 months ago
config.sample.json Add message editing to sample also 10 months ago
karma.conf.js Remove karma junit output 11 months ago
package.json remove emojione 10 months ago
postcss.config.js Use the postcss-webpack-loader 3 years ago yarn neds --new-version to make a new version 1 year ago
release_config.yaml We are now [email protected] 11 months ago
webpack.config.js tell webpack about woff & woff2 files 10 months ago
yarn.lock Patch 21/05/2019 10 months ago Matrix Matrix (which is forked from is a Matrix web client built using the Matrix React SDK. Matrix is officially supported on the web in modern versions of Chrome, Firefox, and Safari. Other browsers may work, however official support is not provided.

Getting Started

The easiest way to test Matrix is to just use the hosted copy at

To host your own copy of Matrix, the quickest bet is to use a pre-built released version of Matrix:

  1. Download the latest version from
  2. Untar the tarball on your web server
  3. Move (or symlink) the Matrix-x.x.x directory to an appropriate name
  4. If desired, copy config.sample.json to config.json and edit it as desired. See below for details.
  5. Enter the URL into your browser and log into Matrix!

Note that Chrome does not allow microphone or webcam access for sites served over http (except localhost), so for working VoIP you will need to serve Matrix over https.

To install Matrix as a desktop application, see Running as a desktop app below.

Building From Source Matrix is a modular webapp built with modern ES6 and uses a Node.js build system. Ensure you have the latest LTS version of Node.js installed.

Using yarn instead of npm is recommended. Please see the Yarn install guide if you do not have it already.

  1. Install or update node.js so that your node is at least v10.x.
  2. Install yarn if not present already.
  3. Clone the repo: git clone
  4. Switch to the riot-fork directory: cd riot-fork.
  5. Install the prerequisites: yarn install.
  6. If you're using the develop branch then it is recommended to set up a proper development environment (“Setting up a dev environment” below) however one can install the develop versions of the dependencies instead:

    Whenever you git pull on riot-fork you will also probably need to force an update to these dependencies - the simplest way is to re-run the script, but you can also manually update and rebuild them:

    cd matrix-js-sdk
    git pull
    yarn install # re-run to pull in any new dependencies
    cd ../matrix-react-sdk
    git pull
    yarn install
  7. Configure the app by copying config.sample.json to config.json and modifying it (see below for details).
  8. yarn dist to build a tarball to deploy. Untaring this file will give a version-specific directory containing all the files that need to go on your web server.

Note that yarn dist is not supported on Windows, so Windows users can run yarn build, which will build all the necessary files into the webapp directory. The version of Matrix will not appear in Settings without using the dist script. You can then mount the webapp directory on your webserver to actually serve up the app, which is entirely static content.


You can configure the app by copying config.sample.json to config.json and customising it:

For a good example, see

  1. default_server_name sets the default server name to use for authentication. This will trigger Matrix to ask https://<server_name>/.well-known/matrix/client for the homeserver and identity server URLs to use. This is the recommended approach for setting a default server. However, it is also possible to use the following to directly configure each of the URLs:
    • default_hs_url sets the default homeserver URL.
    • default_is_url sets the default identity server URL (this is the server used for verifying third party identifiers like email addresses). If this is blank, registering with an email address, adding an email address to your account, or inviting users via email address will not work. Matrix identity servers are very simple web services which map third party identifiers (currently only email addresses) to matrix IDs: see for more details. Currently the only public matrix identity servers are and In the future, identity servers will be decentralised.
    • Matrix will report an error if you accidentally configure both default_server_name and default_hs_url since it's unclear which should take priority.
  2. features: Lookup of optional features that may be enabled, disabled, or exposed to the user in the labs section of settings. The available optional experimental features vary from release to release.
  3. brand: String to pass to your homeserver when configuring email notifications, to let the homeserver know what email template to use when talking to you.
  4. branding: Configures various branding and logo details, such as:
    1. welcomeBackgroundUrl: An image to use as a wallpaper outside the app during authentication flows
    2. authHeaderLogoUrl: An logo image that is shown in the header during authentication flows
    3. authFooterLinks: a list of links to show in the authentication page footer: [{"text": "Link text", "url": ""}, {"text": "Other link", ...}]
  5. integrations_ui_url: URL to the web interface for the integrations server. The integrations server is not Matrix and normally not your homeserver either. The integration server settings may be left blank to disable integrations.
  6. integrations_rest_url: URL to the REST interface for the integrations server.
  7. integrations_widgets_urls: list of URLs to the REST interface for the widget integrations server.
  8. bug_report_endpoint_url: endpoint to send bug reports to (must be running a server). Bug reports are sent when a user clicks “Send Logs” within the application. Bug reports can be disabled by leaving the bug_report_endpoint_url out of your config file.
  9. roomDirectory: config for the public room directory. This section is optional.
  10. roomDirectory.servers: List of other homeservers’ directories to include in the drop down list. Optional.
  11. default_theme: name of theme to use by default (e.g. ‘light’)
  12. update_base_url (electron app only): HTTPS URL to a web server to download updates from. This should be the path to the directory containing macos and win32 (for update packages, not installer packages).
  13. cross_origin_renderer_url: URL to a static HTML page hosting code to help display encrypted file attachments. This MUST be hosted on a completely separate domain to anything else since it is used to isolate the privileges of file attachments to this domain. Default: This needs to contain v1.html from
  14. piwik: Analytics can be disabled by setting piwik: false or by leaving the piwik config option out of your config file. If you want to enable analytics, set piwik to be an object containing the following properties:
    1. url: The URL of the Piwik instance to use for collecting analytics
    2. whitelistedHSUrls: a list of HS URLs to not redact from the analytics
    3. whitelistedISUrls: a list of IS URLs to not redact from the analytics
    4. siteId: The Piwik Site ID to use when sending analytics to the Piwik server configured above
  15. welcomeUserId: the user ID of a bot to invite whenever users register that can give them a tour
  16. embeddedPages: Configures the pages displayed in portions of Matrix that embed static files, such as:
    1. welcomeUrl: Initial content shown on the outside of the app when not logged in. Defaults to welcome.html supplied with Matrix.
    2. homeUrl: Content shown on the inside of the app when a specific room is not selected. By default, no home page is configured. If one is set, a button to access it will be shown in the top left menu.

Note that index.html also has an og:image meta tag that is set to an image hosted on This is the image used if links to your copy of Matrix appear in some websites like Facebook, and indeed Matrix itself. This has to be static in the HTML and an absolute URL (and HTTP rather than HTTPS), so it's not possible for this to be an option in config.json. If you'd like to change it, you can build Matrix as above, but run Matrix_OG_IMAGE_URL="" yarn build. Alternatively, you can edit the og:image meta tag in index.html directly each time you download a new version of Matrix.

Running as a Desktop app Matrix can also be run as a desktop app, wrapped in electron.

To build it yourself, follow the instructions below.

  1. Follow the instructions in ‘Building From Source’ above, but run yarn build instead of yarn dist (since we don't need the tarball).

  2. Install electron and run it:

    yarn electron

To build packages, use electron-builder. This is configured to output:

See for dependencies required for building packages for various platforms.

The only platform that can build packages for all three platforms is macOS:

brew install wine --without-x11
brew install mono
brew install gnu-tar
yarn install
yarn build:electron

For other packages, use electron-builder manually. For example, to build a package for 64 bit Linux:

  1. Follow the instructions in ‘Building From Source’ above
  2. node_modules/.bin/build -l --x64

All electron packages go into electron_app/dist/

Many thanks to @aviraldg for the initial work on the electron integration.

Other options for running as a desktop app:

  • points out that you can use nativefier and it just works(tm)
yarn global add nativefier

Desktop app configuration

To run multiple instances of the desktop app for different accounts, you can launch the executable with the --profile argument followed by a unique identifier, e.g riot-fork --profile Work for it to run a separate profile and not interfere with the default one.

Alternatively, a custom location for the profile data can be specified using the --profile-dir flag followed by the desired path.

To change the config.json for the desktop app, create a config file which will be used to override values in the config which ships in the package:

  • %APPDATA%\$NAME\config.json on Windows
  • $XDG_CONFIG_HOME\$NAME\config.json or ~/.config/$NAME/config.json on Linux
  • ~Library/Application Support/$NAME/config.json on macOS

In the paths above, $NAME is typically Matrix, unless you use --profile $PROFILE in which case it becomes Matrix-$PROFILE.

Running from Docker

To build the image yourself:

git clone
cd riot-fork
git checkout master
docker build -t koyuawsmbrtn/riot-fork .

Labs Features

Some features of Matrix may be enabled by flags in the Labs section of the settings. Some of these features are described in


Before attempting to develop on Matrix you must read the developer guide for matrix-react-sdk, which also defines the design, architecture and style for Matrix too.

You should also familiarise yourself with the “Here be Dragons” guide to the tame & not-so-tame dragons (gotchas) which exist in the codebase.

The idea of Matrix is to be a relatively lightweight “skin” of customisations on top of the underlying matrix-react-sdk. matrix-react-sdk provides both the higher and lower level React components useful for building Matrix communication apps using React.

After creating a new component you must run yarn reskindex to regenerate the component-index.js for the app (used in future for skinning).

Please note that Matrix is intended to run correctly without access to the public internet. So please don't depend on resources (JS libs, CSS, images, fonts) hosted by external CDNs or servers but instead please package all dependencies into Matrix itself.

Setting up a dev environment

Much of the functionality in Matrix is actually in the matrix-react-sdk and matrix-js-sdk modules. It is possible to set these up in a way that makes it easy to track the develop branches in git and to make local changes without having to manually rebuild each time.

First clone and build matrix-js-sdk:

git clone
pushd matrix-js-sdk
git checkout develop
yarn link
yarn install

Then similarly with matrix-react-sdk:

git clone
pushd matrix-react-sdk
git checkout develop
yarn link
yarn link matrix-js-sdk
yarn install

Finally, build and start Matrix itself:

git clone https://git.koyu.pace/koyu/riot-fork
cd riot-fork
git checkout develop
yarn link matrix-js-sdk
yarn link matrix-react-sdk
yarn install
yarn start

Wait a few seconds for the initial build to finish; you should see something like:

Hash: b0af76309dd56d7275c8
Version: webpack 1.12.14
Time: 14533ms
         Asset     Size  Chunks             Chunk Names
     bundle.js   4.2 MB       0  [emitted]  main
    bundle.css  91.5 kB       0  [emitted]  main  5.29 MB       0  [emitted]  main   116 kB       0  [emitted]  main
    + 1013 hidden modules

Remember, the command will not terminate since it runs the web server and rebuilds source files when they change. This development server also disables caching, so do NOT use it in production.

Open in your browser to see your newly built Matrix.

When you make changes to matrix-react-sdk or matrix-js-sdk they should be automatically picked up by webpack and built.

If you add or remove any components from the Matrix skin, you will need to rebuild the skin's index by running, yarn reskindex.

If any of these steps error with, file table overflow, you are probably on a mac which has a very low limit on max open files. Run ulimit -Sn 1024 and try again. You'll need to do this in each new terminal you open before building Matrix.

Running the tests

There are a number of application-level tests in the tests directory; these are designed to run in a browser instance under the control of karma. To run them:

  • Make sure you have Chrome installed (a recent version, like 59)
  • Make sure you have matrix-js-sdk and matrix-react-sdk installed and built, as above
  • yarn test

The above will run the tests under Chrome in a headless mode.

You can also tell karma to run the tests in a loop (every time the source changes), in an instance of Chrome on your desktop, with yarn test-multi. This also gives you the option of running the tests in ‘debug’ mode, which is useful for stepping through the tests in the developer tools.