Usage of the matrix-js-sdk

Here's a list of Frequently asked questions about Matrix..

Making a Matrix Client

This article will explore the Matrix Client-Server API, making use of the matrix-js-sdk. Later articles may discuss making the underlying calls. Specifically we will cover:

  • login
  • simple syncing
  • listening for timeline events
  • access the MatrixInMemoryStore
  • sending messages to rooms
  • how to respond to specific messages, as a bot would

Let's write JavaScript

We’ll use Node.js as our environment, though the matrix-js-sdk can also be used directly in the browser.

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Before we start, make sure you have Node.js and NPM installed: follow instructions at nodejs.org for your platform. Then create a new directory to work in:

Login with an access token

Once you’re ready, the first thing to do is install the matrix-js-sdk from NPM:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

We include the SDK in our source exactly as expected:

Guides

© 2019 The Matrix.org Foundation