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

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

  event: 'login-with-token',
  loginToken: 'your-token'
}, '');

Thank you very much for the guidance here. I am wondering if I can use 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?