JSEP stands for JavaScript Session Establishment Protocol.
JSEP is an IETF draft that describes the offer/answer architecture WebRTC uses to establish sessions. It defines how JavaScript applications interact with the WebRTC engine to create, modify, and terminate multimedia sessions using SDP.
How JSEP works
Rather than implementing a full signaling stack in the browser, JSEP puts the application developer in control of signaling. The browser handles the media negotiation through the PeerConnection API, while the application is responsible for transporting the SDP messages between peers using whatever signaling mechanism it chooses.
The JSEP flow works as follows:
- The initiating peer calls
createOffer()to generate a local SDP offer - It calls
setLocalDescription()with this offer - The application sends the SDP to the remote peer via its signaling channel
- The remote peer calls
setRemoteDescription()with the received offer - It calls
createAnswer()to generate an SDP answer - It calls
setLocalDescription()with this answer - The answer is sent back to the initiating peer, which applies it with
setRemoteDescription()
This design decision – keeping signaling out of the browser – is one of the most important architectural choices in WebRTC, giving developers maximum flexibility in how they build their applications.


