{"id":23099177,"url":"https://github.com/giovannicalo/js-wrtc-ws-api-client","last_synced_at":"2026-04-28T08:07:28.935Z","repository":{"id":89746253,"uuid":"543814642","full_name":"giovannicalo/js-wrtc-ws-api-client","owner":"giovannicalo","description":"JavaScript WebRTC WebSocket Signaling API Client","archived":false,"fork":false,"pushed_at":"2025-05-01T20:59:07.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T21:49:46.598Z","etag":null,"topics":["api","client","signaling","webrtc","websocket"],"latest_commit_sha":null,"homepage":"","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/giovannicalo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-30T22:40:38.000Z","updated_at":"2025-05-01T20:59:11.000Z","dependencies_parsed_at":"2024-01-21T11:31:09.667Z","dependency_job_id":"1c174ced-4c3e-42fa-ab25-2d7bf6394cac","html_url":"https://github.com/giovannicalo/js-wrtc-ws-api-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/giovannicalo/js-wrtc-ws-api-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovannicalo%2Fjs-wrtc-ws-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovannicalo%2Fjs-wrtc-ws-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovannicalo%2Fjs-wrtc-ws-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovannicalo%2Fjs-wrtc-ws-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giovannicalo","download_url":"https://codeload.github.com/giovannicalo/js-wrtc-ws-api-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovannicalo%2Fjs-wrtc-ws-api-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":["api","client","signaling","webrtc","websocket"],"created_at":"2024-12-16T23:18:30.262Z","updated_at":"2026-04-28T08:07:28.889Z","avatar_url":"https://github.com/giovannicalo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript WebRTC WebSocket Signaling API Client\n\n[![Build Status](https://github.com/giovannicalo/js-wrtc-ws-api-client/actions/workflows/build.yml/badge.svg)](https://github.com/giovannicalo/js-wrtc-ws-api-client/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/giovannicalo/js-wrtc-ws-api-client/badge.svg?branch=master)](https://coveralls.io/github/giovannicalo/js-wrtc-ws-api-client?branch=master)\n\n## Installation\n\n```bash\nnpm install giovannicalo/js-wrtc-ws-api-client\n```\n\n\u003e Not yet published to NPM. This will install it from GitHub.\n\n## Usage\n\n```javascript\nimport Client from \"wrtc-ws-api-client\";\n\nconst client = new Client(\"ws://localhost:8080\");\n\nclient.addEventListener(\"foo\", ({ data: { bar } }) =\u003e {\n    // Do something\n});\n\nclient.send({ data: { bar: 42 }, event: \"foo\" });\n```\n\n## API\n\n### `new Client(url: string, options?: Options)`\n\nCreates a WebSocket client and uses it to connect to the server running at `url`. Extends [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget).\n\nOptions are:\n\n* `getAuthenticationData?(): { [key: string]: JsonSerializable }`: a function that returns data required for authentication, e.g. a token, which will be sent to the server upon connection, defaults to `undefined`.\n* `log?(level: string, message: string): void`: a logging function that will be called when certain events occur, defaults to `undefined`.\n* `reconnectionInterval?: number`: the interval between reconnection attempts, in milliseconds, defaults to `1000`.\n* `role?: string`: the client's role, which will be sent to the server upon connection, defaults to `client`.\n\n#### `close(): void`\n\nPermanently closes the connection.\n\n#### `id: null | number | string`\n\nThe `Client`'s ID, returned by the server upon successful authentication.\n\n#### `send(message: JsonSerializable): void`\n\nSends a `message` to the server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovannicalo%2Fjs-wrtc-ws-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiovannicalo%2Fjs-wrtc-ws-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovannicalo%2Fjs-wrtc-ws-api-client/lists"}