{"id":30432776,"url":"https://github.com/dbidwell94/rtc.io","last_synced_at":"2026-05-08T14:04:32.431Z","repository":{"id":44547901,"uuid":"456024457","full_name":"dbidwell94/rtc.io","owner":"dbidwell94","description":"A simple, easy-to-use abstraction of the WebRTC library","archived":false,"fork":false,"pushed_at":"2022-02-09T11:07:02.000Z","size":329,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-17T20:28:44.192Z","etag":null,"topics":["rtcpeerconnection","socket-io","webrtc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/dbidwell94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-06T01:00:08.000Z","updated_at":"2022-02-07T19:32:36.000Z","dependencies_parsed_at":"2022-09-10T05:20:50.069Z","dependency_job_id":null,"html_url":"https://github.com/dbidwell94/rtc.io","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/dbidwell94/rtc.io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2Frtc.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2Frtc.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2Frtc.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2Frtc.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbidwell94","download_url":"https://codeload.github.com/dbidwell94/rtc.io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2Frtc.io/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271703841,"owners_count":24806529,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["rtcpeerconnection","socket-io","webrtc"],"created_at":"2025-08-22T21:32:47.412Z","updated_at":"2026-05-08T14:04:32.422Z","avatar_url":"https://github.com/dbidwell94.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rtcio\n\n\u003c!--toc:start--\u003e\n\n- [rtcio](#rtcio)\n  - [Features](#features)\n  - [Roadmap](#roadmap)\n  - [Usage/Examples](#usageexamples)\n  - [Testing](#testing)\n  - [API Documentation](#api-documentation)\n  \u003c!--toc:end--\u003e\n\n\u003e [!WARNING]\n\u003e This package is under heavy development. Expect API to change\n\u003e with minor version bumps until a major version of \u003e 0 gets\n\u003e published. While the core library API is relatively stable,\n\u003e other addons such as `@rtcio/react` will change quickly\n\nInspired by socket.io, rtcio is an easier to use way of dealing with WebRTC.\nIt wraps the logic of creating RTCPeerConnections in easy-to-use callback\nchaining.\n\nThe GIF below highlights the use of the `@rtcio/signal-local`, the debug features,\nand the `@rtcio/react` wrapper to get working peer to peer connections for\nlocal development. The demo is currently a work in progress, but can be viewed\nin the `demo` package in the GitHub repository.\n\n![Working peer to peer connections in Firefox using the LocalSignalServer and React wrapper](https://raw.githubusercontent.com/dbidwell94/rtc.io/refs/heads/master/assets/rtcio.gif)\n\n## Features\n\n- Built in TypeScript and is fully typed\n- Works with your custom signal server via an implemented interface\n  - Also has pre-built client-side signal server implementations\n    - @rtcio/socket-io-client\n    - @rtcio/signal-local\n  - Default server side signaler implementation available at:\n    - @rtcio/socket-io-server\n- Binary data handling\n- Automatic data chunking with configurable chunk sizes\n  - Support for out-of-order binary data receiving\n- Native support for sending `File`s\n  - Uses `ReadableStream` under the hood to reduce memory allocations\n    for both sending and receiving large data files\n  - Binary data is handled on a completely different data channel so as\n    not to clog up real time messaging events\n- Generic typed parameters for custom events listeners and emitters\n- Logging available via the [debug](https://www.npmjs.com/package/debug) library\n  - All packages are scoped to their npm name -- `rtcio:{pkg-name}:{class-name}:[instanceId]{:logLevel?}`\n    - Log Levels:\n      - warn\n      - error\n      - verbose\n      - log (will not include a log level)\n    - eg. `rtcio:core:RTC:[1a2b3c4d]:warn This is a warning level`\n    - eg. `rtcio:signal-local:LocalSignalServer:[1a2b3c4d] This is a standard log`\n- Create your own signaler by extending `ClientSignaler` in `@rtcio/signaling`\n- A React wrapper via the `@rtcio/react` package.\n\n## Roadmap\n\n- Handle audio and visual streams\n- Custom signaler with raw websockets\n- Custom signaler with raw Server Sent Events (SSE)\n\n## Usage/Examples\n\n```typescript\nimport { RTC } from \"@rtcio/core\";\nimport { SocketIoSignaler } from \"@rtcio/socket-io-client\";\n\nconst ROOM_NAME = \"signalerRoom1\";\n\ninterface MyCustomEvents {\n  message: (messageText: string) =\u003e void;\n}\n\n// There is a default server implementation for socket.io at\n// `@rtcio/socket-io-server`\nconst io = new RTC\u003cMyCustomEvents\u003e(new SocketIoSignaler(socketArgs), ROOM_NAME);\n\nconst idResult = await io.connectToRoom();\nif (idResult.isError()) {\n  // Unable to connect to the signal server\n  console.error(idResult.error);\n  return;\n}\n\nconst myLocalId = idResult.value;\n\n// Here we are 100% sure we have a valid connection AND a data channel\n// This event is fired when a new remote peer has a direct connection to you.\n// You can subscribe, unsubscribe, and emit events directly to the peer\nio.on(\"connected\", (newPeer) =\u003e {\n  newPeer.emit(\"message\", \"Hello, and welcome to rtcio!\");\n\n  newPeer.on(\"message\", (messageText) =\u003e {\n    console.log(`New message from ${newPeer.id}: ${messageText}`);\n  });\n});\n\nconst roomPeers = io.getRoomPeers();\n\nfor (const peerId of roomPeers) {\n  // awaiting here doesn't actually wait for the connection.\n  // it's purely for the RTCPeerConnection to acquire all the\n  // data it needs to send to the signal server.\n  // You do _not_ have to await this for the connection to process.\n  await io.connectToPeer(peerId);\n}\n```\n\n## Testing\n\nrtcio provides a local signaler as well which is useful for testing.\nThe package is `@rtcio/signal-local`. Just remember that because\nsignalers should happen on each client, and here you are emulating 2\nclients, you need 2 signal servers.\n\n```typescript\nimport { RTC } from \"@rtcio/core\";\nimport { LocalSignalServer } from \"@rtcio/signal-local\";\n\nconst ROOM_NAME = \"TEST_ROOM\";\n\nconst client1 = new RTC(new LocalSignalServer(), ROOM_NAME);\nconst client2 = new RTC(new LocalSignalServer(), ROOM_NAME);\n\n// This should not be done in production, but the LocalSignalServer will\n// not fail to connect as it uses BroadcastChannel behind the scenes.\nconst client2Id = (await client2.connectToRoom()).unwrap();\nconst client1Id = (await client1.connectToRoom()).unwrap();\n\nclient2.on(\"connectionRequest\", async (req) =\u003e {\n  if (req.remoteId === client1Id) {\n    await req.accept();\n  } else {\n    req.reject();\n  }\n});\n\nclient2.on(\"connected\", (peer1) =\u003e {\n  console.log(`Peer1 connected with id ${peer1.id}`);\n});\n\nawait client1.connectToPeer(client2Id);\n```\n\n\u003e [!IMPORTANT]\n\u003e If testing locally on Firefox, you MUST use your local IP instead of `localhost`.\n\u003e This is a known issue in Firefox and cannot be fixed.\n\n### Example with `vite`\n\n- locahost:5173 for localdev would be 192.168.xx.x:5173\n- This can be easily done using vite --host as seen in the\n  `demo` package in this repository\n\n\u003e\n\n## API Documentation\n\nAPI documentation is coming in the near future, implemented via `typedoc`,\nand will be available on GitHub Pages once the integration is complete.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbidwell94%2Frtc.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbidwell94%2Frtc.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbidwell94%2Frtc.io/lists"}