{"id":18011234,"url":"https://github.com/bandwidth/node-webrtc","last_synced_at":"2025-03-26T15:32:35.634Z","repository":{"id":41429872,"uuid":"271573846","full_name":"Bandwidth/node-webrtc","owner":"Bandwidth","description":"Node SDK for Bandwidth's WebRTC API","archived":true,"fork":false,"pushed_at":"2025-02-13T12:48:55.000Z","size":881,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-22T02:02:34.923Z","etag":null,"topics":["webrtc"],"latest_commit_sha":null,"homepage":"","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/Bandwidth.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-11T14:53:49.000Z","updated_at":"2025-03-06T20:05:09.000Z","dependencies_parsed_at":"2023-02-12T04:46:19.367Z","dependency_job_id":"396b8b2b-eb7e-4a51-b179-510145d7fba4","html_url":"https://github.com/Bandwidth/node-webrtc","commit_stats":{"total_commits":70,"total_committers":17,"mean_commits":4.117647058823529,"dds":0.8428571428571429,"last_synced_commit":"0f2e4b8b6e222f5559de8734fe62fbaff70df06d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fnode-webrtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fnode-webrtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fnode-webrtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fnode-webrtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bandwidth","download_url":"https://codeload.github.com/Bandwidth/node-webrtc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681516,"owners_count":20655212,"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":["webrtc"],"created_at":"2024-10-30T03:07:47.330Z","updated_at":"2025-03-26T15:32:35.627Z","avatar_url":"https://github.com/Bandwidth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bandwidth WebRTC\r\n\r\n[![Test](https://github.com/Bandwidth/node-webrtc/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/node-webrtc/actions/workflows/test.yml)\r\n\r\n|    **OS**    | **Node** |\r\n|:------------:|:---:|\r\n| Windows 2019 | 12, 14, 16 |\r\n| Windows 2022 | 12, 14, 16 |\r\n| Ubuntu 22.04 | 12, 14, 16 |\r\n| Ubuntu 24.04 | 12, 14, 16 |\r\n\r\n\r\n## Installation\r\n\r\nUse the following command to install the package.\r\n\r\n```\r\nnpm install @bandwidth/webrtc\r\n```\r\n\r\n## SDK Setup\r\n\r\nThe following code will initialize the SDK client.\r\n\r\n```typescript\r\nimport { Client } from '@bandwidth/webrtc';\r\n\r\nconst client = new Client({\r\n  basicAuthUserName: 'user',\r\n  basicAuthPassword: 'pass'\r\n})\r\n```\r\n\r\n## Create Session\r\n\r\n```typescript\r\nimport { Client, Session, ApiController } from '@bandwidth/webrtc';\r\n\r\nconst client = new Client({\r\n  basicAuthUserName: 'user',\r\n  basicAuthPassword: 'pass',\r\n})\r\nconst controller = new ApiController(client);\r\nconst accountId = 'accountId0';\r\nconst body: Session = {\r\n  tag: 'session1'\r\n};\r\n\r\nconst response = await controller.createSession(accountId, body);\r\nconsole.log(response.result.id);\r\n```\r\n\r\n## Create Participant\r\n\r\n```typescript\r\nimport {\r\n  Client,\r\n  Participant,\r\n  ApiController,\r\n  ParticipantSubscription,\r\n  Subscriptions,\r\n} from '@bandwidth/webrtc';\r\n\r\nconst client = new Client({\r\n  basicAuthUserName: 'user',\r\n  basicAuthPassword: 'pass',\r\n})\r\nconst controller = new ApiController(client);\r\nconst accountId = 'accountId0';\r\n\r\nconst body: Participant = {\r\n  callbackUrl: 'https://example.com/callback',\r\n  tag: 'participant1',\r\n  deviceApiVersion: 'v3'\r\n};\r\n\r\nconst response = await controller.createParticipant(accountId, body);\r\nconsole.log(response.result.participant.id);\r\n```\r\n\r\n## Add Participant to Session\r\n\r\n```typescript\r\nimport {\r\n  ApiController,\r\n  Client\r\n} from '@bandwidth/webrtc';\r\n\r\nconst client = new Client({\r\n  basicAuthUserName: 'user',\r\n  basicAuthPassword: 'pass',\r\n})\r\nconst controller = new ApiController(client);\r\n\r\nconst accountId = '01234';\r\nconst sessionId = '56789';\r\nconst participantId = '012';\r\n\r\nconst participant1 = {\r\n    participantId: '456'\r\n};\r\n\r\nconst participant2 = {\r\n  participantId: '789',\r\n  streamAliases: ['alias1', 'alias2']\r\n};\r\n\r\nconst sessionIdArg = '012345';\r\n\r\nconst subscriptions = {\r\n  sessionId: sessionIdArg,\r\n  participants: [participant1, participant2]\r\n};\r\n\r\ncontroller.addParticipantToSession(accountId, sessionId, participantId, subscriptions);\r\n\r\n```\r\n\r\n## Bandwidth's WebRTC References\r\n\r\nPlease visit our [WebRTC home page](https://dev.bandwidth.com/docs/webrtc) for more information on Bandwidth's WebRTC platform.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandwidth%2Fnode-webrtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbandwidth%2Fnode-webrtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandwidth%2Fnode-webrtc/lists"}