Rocket.chat.Livechat how to use param "/livechat/1.0/"

Hi all,

I had build project https://github.com/RocketChat/Rocket.Chat.Livechat with code “yarn start”, it so oke. However I want to use code javascript

(function(w, d, s, u) {
		w.RocketChat = function(c) { w.RocketChat._.push(c) };
		w.RocketChat._ = [];
		w.RocketChat.url = u;
		var h = d.getElementsByTagName(s)[0],
			j = d.createElement(s);
		j.async = true;
		j.src = 'http://localhost:8080/livechat/1.0/rocketchat-livechat.min.js?_=' + Math.random();
		h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'http://localhost:8080/livechat?version=1.0');

Error url not found “http://localhost:8080/livechat/1.0/rocketchat-livechat.min.js

how to use Url it? please help me

I’ve invited one of the guys that works on this to the thread.

But, I think it has something to do with the src. I think have to change to a path that yarn is actually serving up.

you can guide me? I used npm install, it will error don’t start app

Is not 1.0, is 1.0.0.
Please, change the url path and try again.
Other important thing: http://localhost:8080 is where you’re running the livechat as a standalone application, so you need to change the bundle url path, addressing to your Rocket.Chat url, like:
j.src = ‘http://localhost:3000/livechat/1.0.0/rocketchat-livechat.min.js?_=’ + Math.random();

2 Likes