In the PeerJS documentation it says that you can attach metadata to a peer.connect call, like this:
var conn = peer.connect(peerID, { metadata: { userName: 'name goes here' } });
Then you can access the metadata like this:
peer.on('connection', function(conn) {
var userName = conn.metadata.userName;
});