Need guide in integrating RocketChat to my website

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.

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>```

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.

Hello i used this code but the integration not wrking, can you help me?