Join a session

By calling session.connect method you can join a properly initialized session.

session.connect(token)
    .then( ... )
    .catch( ... );


You must ask OpenVidu Server for a user token. To do so:

  1. Initialize a Session in OpenVidu Server

  2. Generate a token for this session in OpenVidu Server

  3. Return this token to your client-side to use it on Session.connect()

You can add an optional second parameter to pass some user metadata that will be recieved by every other user connected to the same session (check Share data between users to learn more).

session.connect(token, DATA)
    .then( ... )
    .catch( ... );