After exchanging SDP, it's essential to exchange network information to establish a connection fully. Within the peerConnection.onicecandidate() callback function, obtain the network information and submit it to the server.

Here's how you can do it:

peerConnection.onicecandidate = async (event) => {
      if (!event.candidate) {
        return
      }
      await fetch(`https://apis.elai.io/api/v1/stream/candidate/${streamId}`, {
        method: "POST",
        body: JSON.stringify({ candidate: event.candidate })
      })
    }
Language
Credentials
Header
Click Try It! to start a request and see the response here!