{"id":18927765,"url":"https://github.com/observertc/observer-js","last_synced_at":"2025-04-15T13:34:22.962Z","repository":{"id":152391380,"uuid":"625439809","full_name":"ObserveRTC/observer-js","owner":"ObserveRTC","description":"Server-side component to monitor WebRTC stack","archived":false,"fork":false,"pushed_at":"2024-04-10T16:29:41.000Z","size":476,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-13T20:52:15.752Z","etag":null,"topics":["monitoring","nodejs","webrtc"],"latest_commit_sha":null,"homepage":"https://observertc.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ObserveRTC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2023-04-09T05:29:51.000Z","updated_at":"2024-04-15T09:02:34.267Z","dependencies_parsed_at":null,"dependency_job_id":"e75b682d-a005-4339-9712-3261193e6f85","html_url":"https://github.com/ObserveRTC/observer-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fobserver-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fobserver-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fobserver-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fobserver-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ObserveRTC","download_url":"https://codeload.github.com/ObserveRTC/observer-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673980,"owners_count":17183816,"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":["monitoring","nodejs","webrtc"],"created_at":"2024-11-08T11:20:26.841Z","updated_at":"2024-11-08T11:20:27.584Z","avatar_url":"https://github.com/ObserveRTC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Server side component for monitoring WebRTC applications and services\n---\n\nTable of Contents:\n\n * [Quick Start](#quick-start)\n * [Configurations](#configurations)\n * [NPM package](#npm-package)\n * [Schemas](#schemas)\n * [License](#license)\n\n## Qucik Start\n\nInstall it from [npm](https://www.npmjs.com/package/@observertc/observer-js) package repository.\n\n```\nnpm i @observertc/observer-js\n```\n\nUse it in your server side NodeJS app. \n\n```javascript\nimport { createObserver, ClientSample } from \"@observertc/observer-js\";\n\nconst observer = createObserver({\n    defaultServiceId: 'my-service-name',\n    defaultMediaUnitId: 'my-reporting-component',\n});\n\nconst observedCall = observer.createObservedCall({\n    roomId: 'roomId',\n    callId: 'room-session-id',\n});\n\nconst observedClient = observedCall.createObservedClient({\n    clientId: 'client-id',\n    mediaUnitId: 'media-unit-id',\n});\n\nconst clientSample: ClientSample; // Receive your samples, for example, from a WebSocket\n\nobservedClient.accept(clientSample);\n```\n\nThe above example do as follows:\n 1. create an observer to evaluate samples from clients and sfus\n 2. create a client source object to accept client samples\n 3. add an evaluator process to evaluate ended calls\n\n ### Get a Summary of a call when it ends\n\n ```javascript\n\n const monitor = observer.createCallSummaryMonitor('summary', (summary) =\u003e {\n     console.log('Call Summary', summary);\n });\n ```\n\n ### How Many Clients are using TURN?\n\n```javascript\nconst monitor = observer.createTurnUsageMonitor('turn', (turn) =\u003e {\n    console.log('TURN', turn);\n});\n\n// at any point of time you can get the current state of the turn usage\n\nconsole.log('Currently ', monitor.clients.size, 'clients are using TURN');\n\n// you can get the incoming and outgoing bytes of the TURN server\nconsole.log(`${YOUR_TURN_SERVER_ADDRESS} usage:`, monitor.getUsage(YOUR_TURN_SERVER_ADDRESS));\n\n```\n\n### Monitor Calls and Clients as they updated\n\n```javascript\nobserver.on('newcall', (call) =\u003e {\n    call.on('update', () =\u003e {\n        console.log('Call Updated', call.callId);\n    });\n\n    call.on('newclient', (client) =\u003e {\n\n        client.on('update', () =\u003e {\n            console.log('Client Updated', client.clientId);\n\n            console.log(`The avaialble incoming bitrate for the client ${client.clientId} is: ${client.availableIncomingBitrate}`)\n        });\n    })\n});\n```\n\n## NPM package\n\nhttps://www.npmjs.com/package/@observertc/observer-js\n\n\n## Schemas\n\nhttps://github.com/observertc/schemas\n\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobservertc%2Fobserver-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobservertc%2Fobserver-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobservertc%2Fobserver-js/lists"}