Thanks for helping improve peer-data. By contributing, you agree to abide by the code of conduct.
Search the issue tracker first; if nothing matches, open an issue. Bugs, ideas and usage questions are all welcome. For a bug, include the browser, the signaling you use, and what each peer did.
You need Node.js 24 or newer.
git clone https://github.com/vardius/peer-data.git
cd peer-data
npm ci
npx playwright install chromium firefox webkit
npm testBefore sending a pull request, run what CI runs:
npm run typecheck
npx -y -p typescript@7.0.2 tsc --noEmit
npm run lint
npm run format:check
npm test
npm run build
npm pack --dry-runnpm run format fixes formatting.
On Linux, Firefox gathers no WebRTC candidates when IPv6 is on but has no route, so its tests time out. CI turns
IPv6 off first: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1.
src/holds the library:PeerData,Room,Participant, the signaling types,SocketChannelandBroadcastChannelSignaling.test/holds the tests. They run real peer connections in Chromium, Firefox and WebKit, through an in-memory signaling hub (test/hub.ts) or a socket.io server started for the run, and need no network. To run one browser:npx vitest run --project 'browser (chromium)'.examples/holds runnable examples, whose logic has tests. The website shows them, so keep them short.npm run examplesserves them, with the socket.io signaling server, at http://localhost:5173.website/is the documentation site.
cd website
npm ci
npm run dev- For a large change, open an issue first so we can agree on the approach.
- Branch from
master, keep the change focused, and add a test that fails without it.