Skip to main content

Join to conference

To join a room or conference, call the join method. This should be called before invoking any other methods in the SDK. Pass the room name, user ID, and user name. The response of this method will include the details of participants and remote streams. The join method also accepts some custom attributes that can be used for your business logic.

How to use join method

    const response = await twyng.join(ConferenceJoinInfo)

ConferenceJoinInfo(Object)

FieldtypeDescription
roomIdstring or numberThe roomId is used to create namespaces where only certain user groups can gather. Each room is identified by a unique room ID.. Each room is identified by a unique room ID
userIdstring or numberThe userId is used to uniquely identify each user.
namestringThe name is used for displaying
attributes (optional)string or number or objectThe attributes are available in the remote streams object of that particular user. These can be used for building custom logic.
recordbooleanTo see more details in Record conference
recordUrlstringTo see more details in Record conference

Response of the join method

Fieldtype
status (optional)boolean
result (optional)JoinResult
error (optional)object

JoinResult

Fieldtype
streamsArray
participantsArray

Detailed exmaple


const conferenceJoinInfo = {
roomId: 'global-education',
userId: 'student-01',
name: "Jhon Thomas",
attributes: {
rollNo: 21,
division: '12 B',
subject: 'Computer science'
},
record: true,
recordUrl: `https://twyng.com/record/global-education`
}

const response = await twyng.join(conferenceJoinInfo)