This message was deleted.
# helpdesk
s
This message was deleted.
h
Below is my javascript code. --------------------------------------------- import { Room } from 'livekit-client'; const wsURL = "ws://localhost:7880" let token = "<token>" function getToken() { const url = 'http://localhost:8080/getToken'; fetch(url) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.text(); }) .then(data => { token = data console.log('response:', data); }) .catch(error => { console.error('Error:', error); }); } // get Token getToken(); // connect to room const room = new Room(); await room.connect(wsURL, token); console.log('connected to room:', room.name); // publish local camera and mic tracks await room.localParticipant.enableCameraAndMicrophone();
There was information that "navigator" is an object that is set by detecting the browser. Is it correct to understand that I need to create an HTML page and run a javascript file along with it in the browser? I was experimentally running the above javascript file by itself.
e
The
livekit-client
package depends on browser APIs and must be run in a browser. If you’re looking for a way to connect to the LiveKit server using Node.js, this is the package for you: https://www.npmjs.com/package/livekit-server-sdk
Overview of available web, native, and backend clients: https://docs.livekit.io/reference
h
@eager-zoo-16408 Thank you for your reply. I understand.