{"id":14036162,"url":"https://github.com/vardius/peer-data","last_synced_at":"2026-03-11T17:33:03.891Z","repository":{"id":13522258,"uuid":"74482077","full_name":"vardius/peer-data","owner":"vardius","description":"Library for files, media streaming/sharing using WebRTC","archived":false,"fork":false,"pushed_at":"2023-01-03T17:32:20.000Z","size":3531,"stargazers_count":63,"open_issues_count":13,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T03:18:02.382Z","etag":null,"topics":["peer","webrtc"],"latest_commit_sha":null,"homepage":"https://rafallorenz.com/peer-data","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vardius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["vardius"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-11-22T14:44:50.000Z","updated_at":"2025-03-15T08:14:03.000Z","dependencies_parsed_at":"2023-01-13T17:30:31.133Z","dependency_job_id":null,"html_url":"https://github.com/vardius/peer-data","commit_stats":null,"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fpeer-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fpeer-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fpeer-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fpeer-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vardius","download_url":"https://codeload.github.com/vardius/peer-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243837011,"owners_count":20355813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["peer","webrtc"],"created_at":"2024-08-12T03:01:51.460Z","updated_at":"2026-03-11T17:33:03.851Z","avatar_url":"https://github.com/vardius.png","language":"JavaScript","funding_links":["https://github.com/sponsors/vardius"],"categories":["JavaScript"],"sub_categories":[],"readme":"# PeerData\n[![Build Status](https://travis-ci.org/vardius/peer-data.svg?branch=master)](https://travis-ci.org/vardius/peer-data)\n[![npm version](https://img.shields.io/npm/v/peer-data.svg)](https://www.npmjs.com/package/peer-data)\n[![npm downloads](https://img.shields.io/npm/dm/peer-data.svg)](https://www.npmjs.com/package/peer-data)\n[![license](https://img.shields.io/github/license/vardius/peer-data.svg)](LICENSE)\n\u003c!--[![codecov](https://codecov.io/gh/vardius/peer-data/branch/master/graph/badge.svg)](https://codecov.io/gh/vardius/peer-data)--\u003e\n\n\u003cimg align=\"right\" height=\"180px\" src=\"website/src/static/img/logo.png\" alt=\"logo\" /\u003e\n\nPeerData is a library for bidirectional peer-to-peer transfers of arbitrary data using [RTCDataChannel](https://developer.mozilla.org/pl/docs/Web/API/RTCDataChannel). Simple *WebRTC* wrapper providing data channel abstraction.\n\n[WebRTC](https://webrtc.org/) needs a messaging service to set up and maintain a *WebRTC* call.\n\nThe sender and receiver *RTCPeerConnections* run in web pages on different devices, and we need a way for them to communicate metadata.\nFor this, we use a signaling server: a server that can pass messages between *WebRTC* clients (peers).\n\n[PeerDataServer](https://github.com/vardius/peer-data-server) - An **ready to use** example of signaling server on *Node* using [socket.io](http://socket.io/).\n\n📖 ABOUT\n==================================================\nContributors:\n\n* [Rafał Lorenz](https://rafallorenz.com)\n\nWant to contribute ? Feel free to send pull requests!\n\nHave problems, bugs, feature ideas?\nWe are using the github [issue tracker](https://github.com/vardius/peer-data/issues) to manage them.\n\n## 📚 Documentation\n\nFor **documentation** (_including examples_), **visit [rafallorenz.com/peer-data](https://rafallorenz.com/peer-data)**\n\n🚏 HOW TO USE\n==================================================\n\n1. [Chat Example](https://github.com/vardius/webrtc-chat)\n2. [React Chat Example](https://github.com/vardius/react-webrtc-chat)\n3. [React Hook](https://github.com/vardius/react-peer-data)\n\n## Installation\n```bash\n$ npm install peer-data\n```\n\n## Basic example\n```typescript\nimport PeerData, { EventDispatcher, SocketChannel } from 'peer-data';\n\nconst constraints = {ordered: true};\nconst servers = {\n  iceServers: [\n    {urls: \"stun:stun.1.google.com:19302\"}\n  ]\n};\n\nconst dispatcher = new EventDispatcher();\nconst peerData = new PeerData(dispatcher, servers, constraints);\nconst signaling = new SocketChannel(dispatcher, 'http://localhost:8080');\n\nconst room = peerData.connect('test-room');\n\nroom.on(\"participant\", participant =\u003e {\n  participant.on(\"message\", payload =\u003e console.log(\"message\", payload));\n\n  participant.send('Hi mate! this is private message.');\n})\n```\n\nFor how to **disconnect**, **close connection** and handle errors please check [documentation](https://rafallorenz.com/peer-data/docs/client).\n\n📜 [License](LICENSE.md)\n-------\n\nThis package is released under the MIT license. See the complete license in the package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardius%2Fpeer-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvardius%2Fpeer-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardius%2Fpeer-data/lists"}