2020-03-02 22:17:31 +00:00
|
|
|
Embeddable Matrix Chatbox
|
2019-04-27 12:32:04 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
![Demo video of chatbox](https://media.giphy.com/media/Js8Wm7DdbkuFK4MJUC/giphy.gif)
|
2018-05-26 18:53:54 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
Built on:
|
|
|
|
- [Embeddable React Widget](https://github.com/seriousben/embeddable-react-widget)
|
|
|
|
- [Matrix JS SDK](https://github.com/matrix-org/matrix-js-sdk)
|
2018-05-30 02:14:07 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
## Usage
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2020-03-02 22:17:31 +00:00
|
|
|
<script src="./chatbox.js"></script>
|
|
|
|
<script>
|
|
|
|
EmbeddableChatbox.mount({ matrixServerUrl: "https://matrix.org" });
|
|
|
|
</script>
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2020-03-02 22:17:31 +00:00
|
|
|
Options:
|
|
|
|
| Name | Description | Default
|
|
|
|
| ----------- | ----------- | --------- |
|
|
|
|
| `matrixServerUrl` (required) | URL for the Matrix homeserver you want to connect to | `https://www.matrix.org` |
|
|
|
|
| `userToInvite` (required) | Username of the account that should be invited when a new chat is started | `null` |
|
|
|
|
| `termsUrl` (optional) | URL for the Terms of Use for the chat service | `null` |
|
|
|
|
| `roomName` (optional) | Name of the chatroom generated in Riot | 'Support Chat' |
|
|
|
|
| `introText` (optional) | Text to be shown before the Terms of Use url | `null` |
|
|
|
|
| `agreementText` (optional) | Text to be shown to ask for agreement to continue | `null` |
|
|
|
|
|
|
|
|
## Local development
|
|
|
|
|
|
|
|
Clone the project:
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2020-03-02 22:17:31 +00:00
|
|
|
git clone https://github.com/nomadic-labs/ocrcc-chatbox.git
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2020-03-02 22:17:31 +00:00
|
|
|
Install the dependencies:
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2020-03-02 22:17:31 +00:00
|
|
|
cd ocrcc-chatbox
|
|
|
|
yarn
|
2018-06-03 15:15:23 +00:00
|
|
|
```
|
2018-05-26 18:53:54 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
Start the development server:
|
|
|
|
```
|
|
|
|
yarn start
|
|
|
|
```
|
2018-06-03 15:15:23 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
Open the demo page at http://localhost:9000/
|
2018-06-03 15:15:23 +00:00
|
|
|
|
2020-03-02 22:17:31 +00:00
|
|
|
## Production build
|
|
|
|
```
|
|
|
|
yarn build
|
|
|
|
```
|