0

I am using Ubuntu 16 and I have website built in PHP using Laravel 5.4, I want to setup Rocket.chat on this website. Following things I have done.

  1. installed rocketchat server using snap install rocketchat-server
  2. It is successfully working on http://127.0.0.1:3000
  3. Then I have taken http://127.0.0.1:3000 in HTML iframe tag to display rocket chat on my website.

As per documentation of Rocket chat, I have tried to login in rocket chat but did not get exactly what I have to do.

<script>
Meteor.loginWithPassword('username-or-email', 'your-password');
</script>

But I got error

ReferenceError: Meteor is not defined

Following things, I am trying to do but not getting any way.

  1. When user register in my website then register in rocket chat as well.
  2. When user login in my website then login in rocket chat as well.
  3. Do I need to use its Rest API, if yes then how graphically it will appear in my website?

I think, my approach of doing it is not right so any suggestions? As per my requirements what should be the correct way to implement it?

Jass
  • 3,345
  • 3
  • 24
  • 41

2 Answers2

0

Meteor is defined in your iframe window. to access Meteor you have to define your iframe with a name tag like this

<iframe src="http://192.168.5.134:3000" width="300" height="700" name="rocketIframe">

and then to access iframe's window write this

document.rocketIframe.Meteor

or

window['rocketIframe'].Meteor
Shahzaib Sheikh
  • 647
  • 1
  • 9
  • 21
0

Just in case, do this before:

curl https://install.meteor.com/ | sh

meteor npm install

Verify:

meteor node -v

meteor npm -v

and then start it:

meteor npm start

If there is no errors from the previous commands it should work fine this time. Otherwise the error message can give a clue of what might be causing the issue.

Dharman
  • 30,962
  • 25
  • 85
  • 135