Need guide in integrating RocketChat to my website


#1

I have tried to integrate RocketChat with my website. I looked at the documentation of RocketChat and understood that I need to place a piece of Javascript code to my web page to load the RocketChat javascript library. But the documentation is too brief to me.

However, it is not clear to me how I can pass the authenticated token to RocketChat. It would be very helpful if someone can send me a link or sample html to explain in detail how the integration can be achieved.


#2

This is the section of the documentation for Authentication when using the iframe intergfration https://rocket.chat/docs/developer-guides/iframe-integration/authentication/

You need to log the user in using the REST API which will give you a login token that can be then passed to the iframe with

<script>
window.parent.postMessage({
  event: 'login-with-token',
  loginToken: 'your-token'
}, 'http://your.rocket.chat.url');
</script>```

#3

Thank you very much for the guidance here. I am wondering if I can use open.rocket.chat to test the iframe-integration yet? That is, if the Administration>Account>iFrame integration is enabled? Also I am wondering what is the usage in the iFrame URL property.