{"id":24888643,"url":"https://github.com/substrate-system/webrtc","last_synced_at":"2025-03-27T11:42:09.524Z","repository":{"id":274716460,"uuid":"915850273","full_name":"substrate-system/webrtc","owner":"substrate-system","description":"Simple webrtc","archived":false,"fork":false,"pushed_at":"2025-02-12T02:38:56.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T03:30:05.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/substrate-system.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-13T00:30:36.000Z","updated_at":"2025-02-12T02:38:52.000Z","dependencies_parsed_at":"2025-01-29T00:23:37.196Z","dependency_job_id":"8a2bf04c-e8e9-4c9f-aac0-fc5dd0f12ed0","html_url":"https://github.com/substrate-system/webrtc","commit_stats":null,"previous_names":["substrate-system/webrtc"],"tags_count":0,"template":false,"template_full_name":"nichoth/template-ts-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fwebrtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fwebrtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fwebrtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fwebrtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/substrate-system","download_url":"https://codeload.github.com/substrate-system/webrtc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841500,"owners_count":20681182,"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":[],"created_at":"2025-02-01T16:14:23.015Z","updated_at":"2025-03-27T11:42:09.303Z","avatar_url":"https://github.com/substrate-system.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webrtc\n\n[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)\n[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver\u0026style=flat-square)](https://semver.org/)\n[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)\n[![license](https://img.shields.io/badge/license-Polyform_Non_Commercial-26bc71?style=flat-square)](LICENSE)\n\n\nWebrtc for humans.\n\nThe example code depends on cloudflare as a STUN/TURN server.\nTo run the demo, you will need to create a cloudflare account\nand [generate credentials](https://developers.cloudflare.com/calls/turn/generate-credentials/).\n\n\n\u003cdetails\u003e\u003csummary\u003e\u003ch2\u003eContents\u003c/h2\u003e\u003c/summary\u003e\n\n\u003c!-- toc --\u003e\n\n- [install](#install)\n- [Modules](#modules)\n  * [ESM](#esm)\n  * [Common JS](#common-js)\n  * [pre-built JS](#pre-built-js)\n- [use](#use)\n  * [JS](#js)\n- [develop](#develop)\n  * [`.dev.vars`](#devvars)\n  * [start a local server](#start-a-local-server)\n\n\u003c!-- tocstop --\u003e\n\n\u003c/details\u003e\n\n## install\n\n```sh\nnpm i -S @substrate-system/webrtc\n```\n\n## Modules\n\nThis exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports).\n\n### ESM\n```js\nimport { webrtc } from '@substrate-system/webrtc'\n```\n\n### Common JS\n```js\nconst webrtc = require('@substrate-system/webrtc/module')\n```\n\n### pre-built JS\nThis package exposes minified JS files too. Copy them to a location that is\naccessible to your web server, then link to them in HTML.\n\n#### copy\n```sh\ncp ./node_modules/@substrate-system/webrtc/dist/index.min.js ./public/webrtc.min.js\n```\n\n#### HTML\n```html\n\u003cscript type=\"module\" src=\"/webrtc.min.js\"\u003e\u003c/script\u003e\n```\n\n## use\n\n### JS\n```js\nimport { webrtc } from '@substrate-system/webrtc'\n```\n\n## develop\n\nStart a local websocket server and also a `vite` server for the front-end:\n\nTo run the example, you will need to create a cloudflare account\nand [generate credentials](https://developers.cloudflare.com/calls/turn/generate-credentials/). Paste the credentials into `.dev.vars`.\n\n### `.dev.vars`\n\n```sh\n# .dev.vars\nNODE_ENV=\"development\"\nDEBUG=\"*\"\nCF_TURN_NAME=\"my-server-name\"\nCF_TURN_TOKEN_ID=\"123abc\"\nCF_TURN_API_TOKEN=\"123bc\"\n```\n\n### start a local server\n\n```sh\nnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Fwebrtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubstrate-system%2Fwebrtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Fwebrtc/lists"}