forked from matrix/element-web
ba8751bb75 | ||
---|---|---|
examples | ||
skins/base | ||
src | ||
.gitignore | ||
.npmignore | ||
LICENSE | ||
README.md | ||
package.json |
README.md
matrix-react-sdk
This is a react-based SDK for inserting a Matrix chat client into a web page
Getting started with the trivial example
- Install or update
node.js
so that yournpm
is at least at version2.0.0
- Clone the repo:
git clone https://github.com/matrix-org/matrix-react-sdk.git
- Switch to the SDK directory:
cd matrix-react-sdk
- Install the prerequisites:
npm install
- Switch to the example directory:
cd examples/trivial
- Install the example app prerequisites:
npm install
- Build the example and start a server:
npm start
Now open http://127.0.0.1:8080/ in your browser to see your newly built Matrix client.
Using the example app for development
To work on the CSS and Javascript and have the bundle files update as you change the source files, you'll need to do two extra things:
- Link the react sdk package into the example:
cd matrix-react-sdk/examples/trivial; npm link ../../
- Start a watcher for the CSS files:
cd matrix-react-sdk; npm run start:css
Note that you may need to restart the CSS builder if you add a new file. Note
that npm start
builds debug versions of the the javascript and CSS, which are
much larger than the production versions build by the npm run build
commands.
IMPORTANT: If you customise components in your application (and hence require react from your app) you must be sure to:
- Make your app depend on react directly
- If you
npm link
matrix-react-sdk, manually remove the 'react' directory from matrix-react-sdk'snode_modules
folder, otherwise browserify will pull in both copies of react which causes the app to break.