Home

Awesome

Embeddable Matrix Chatbox

Demo video of chatbox

Live demo: https://nomadic-labs.github.io/safesupport-chatbox/

Built on:

Usage

<script src="https://unpkg.com/safesupport-chatbox" type="text/javascript"></script>
<script>
  var config = {
    matrixServerUrl: 'https://matrix-client.matrix.org',
    botId: '@your-help-bot:matrix.org',
    roomName: 'Support Chat',
    termsUrl: 'https://tosdr.org/',
    introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.',
    agreementMessage: 'Do you want to continue?',
    confirmationMessage: 'Waiting for a facilitator to join the chat...',
    exitMessage: 'The chat is closed. You may close this window.',
    chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
    anonymousDisplayName: 'Anonymous',
  }

  EmbeddableChatbox.mount(config);
</script>

Options:

NameDescriptionDefault
matrixServerUrl (required)URL for the Matrix homeserver you want to connect tohttps://matrix-client.matrix.org
botId (required)User ID for the bot account that handles invitesnull
introMessage (optional)First message the user sees before agreeing to the Terms of UseThis chat application does not collect any of your personal data or any data from your use of this service.
termsUrl (optional)URL for the Terms of Use for the chat servicehttps://tosdr.org/
roomName (optional)Name of the chatroom generated in Riot'Support Chat'
agreementMessage (optional)Text to show to request agreement to the Terms of UseDo you want to continue?
confirmationMessage (optional)Text to show to ask for agreement to continueWaiting for a facilitator to join the chat...
exitMessage (optional)Text to show if the user rejects the Terms of Use.The chat is closed. You may close this window.
anonymousDisplayName (optional)The display name for the chat user.Anonymous
chatUnavailableMessage (optional)Text to show if no-one is available to respondThe chat service is not available right now. Please try again later.

Feature list

Bot account

This chatbox is meant to be used with a bot account that handles a number of functions:

The bot account is invited to the chatroom when a support request is initiated.

You can find the code for the bot at safesupport-bot.

Bookmarklet

The bookmarklet is a special link that runs a script on any website. The user saves the link by dragging it to their bookmarks bar. Then they can click on the bookmark on any page to run the script and load the chatbox.

You can try this out on the live demo.

Local development

Clone the project:

git clone https://github.com/nomadic-labs/safesupport-chatbox.git

Install the dependencies:

cd safesupport-chatbox
yarn

Start the development server:

yarn start

Open the demo page at http://localhost:9000/

Don't forget to also set up the bot account, otherwise you'll never get the chat invitations on Riot. Follow the instructions at safesupport-bot.

Production build

yarn build