Last active
May 13, 2020 13:13
-
-
Save maxklenk/2b3fef6976b5c3e0f42e889200f94b5d to your computer and use it in GitHub Desktop.
Load embedded Riot Chat client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
const matrixAssetDomain = 'https://embed.stomt.com/'; | |
// load javascript | |
const riotScript = document.createElement('script'); | |
riotScript.src = `${matrixAssetDomain}embed.js`; | |
riotScript.type = 'text/javascript'; | |
document.head.appendChild(riotScript); | |
// setup | |
const options = { | |
riotConfig: '/config.json', // custom config | |
indexeddbWorkerScript: '/indexeddb-worker.js', // has to be on websites domain | |
assetDomain: matrixAssetDomain, // where you host the messenger files | |
// session | |
homeserverUrl: '<MATRIX_DOMAIN>', | |
userId: '<USER_ID>', | |
accessToken: '<USER_TOKEN>', | |
deviceId: '<USER_DEVICE>', | |
}; | |
window.Matrix = window.Matrix || []; | |
window.Matrix.push(['setup', options]); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment