peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

Peer custom additional information

Open chientrm opened this issue 3 years ago • 2 comments

Currently this is how we create a peer:

const peer = new Peer('pick-an-id', options); 

Promote feature:

const peer = new Peer('pick-an-id', options, claims); 

Where claims is inspired by Firebase custom claims.

chientrm avatar Apr 04 '22 11:04 chientrm

Hey @chientrm, interesting idea!

Can you tell me a bit more about your use case?

jonasgloning avatar Apr 05 '22 08:04 jonasgloning

Hey @chientrm, interesting idea!

Can you tell me a bit more about your use case?

I am working on a serverless multiplayer lobby. Instead of maintaining a separated services for peer infomation like Full Name, email, age,... I suggest to have a custom field for storing those once initiating a new peer.

This additional data would be pass to dataConnection so that serving peer can retrieve them.

The data type should be any.

This custom infomation is passed directly from peer to peer without peerjs server interfere.

Data size would not be limited because it does not pass via peerjs server.

chientrm avatar Apr 05 '22 09:04 chientrm