const pc = new RTCPeerConnection();
// …
async function logPeerName() {
try {
const identity = await pc.peerIdentity;
console.log(`Peer identity: ${identity.name}`);
} catch (err) {
console.error("Could not verify peer identity:", err);
}
}
logPeerName();RTCIdentityAssertion: name property / notebook
RTCIdentityAssertion: name property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.