{"_id":"@aethex.os/webrtc","_rev":"3-eb1765312aff9c63703f1779c4eb3a3c","name":"@aethex.os/webrtc","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@aethex.os/webrtc","version":"1.0.0","keywords":["aethex","webrtc","voice","video","calls","screen-share","metaverse","p2p"],"author":{"name":"AeThex Corporation"},"license":"MIT","_id":"@aethex.os/webrtc@1.0.0","maintainers":[{"name":"mrpiglr","email":"mrpiglr@aethex.dev"}],"homepage":"https://aethex.dev","bugs":{"url":"https://github.com/AeThex-Corporation/AeThex-OS/issues"},"dist":{"shasum":"2d5182fea35d240348e9a08c364023dd93b408e1","tarball":"https://registry.npmjs.org/@aethex.os/webrtc/-/webrtc-1.0.0.tgz","fileCount":9,"integrity":"sha512-E18tj4GdrVFjZcBIcS7weQBMUtjDNCxqM+h3ztu3eMUJz0v6D8H+FcrnZ8NnralZYw2MRfTcf9g3M1xFkGjBLw==","signatures":[{"sig":"MEQCIBbhw0BgtVvHOb+Dti7fhfxvCDHnNhVde1oobfun4cjvAiBb4b0CczCJDVKdANr86H/DYmmDOmsPvlUlrnRq7NpYvw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17484},"main":"lib/index.js","types":"lib/index.d.ts","browser":true,"engines":{"node":">=18.0.0"},"gitHead":"b094d5c032765a30612c2348ce0356d3a50d9feb","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc"},"_npmUser":{"name":"mrpiglr","email":"mrpiglr@aethex.dev"},"repository":{"url":"git+https://github.com/AeThex-Corporation/AeThex-OS.git","type":"git","directory":"packages/aethex-webrtc"},"_npmVersion":"11.12.1","description":"AeThex WebRTC — voice/video calls, screen sharing, and voice activity detection with socket.io signaling","directories":{},"_nodeVersion":"22.22.0","dependencies":{"socket.io-client":"^4.7.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/webrtc_1.0.0_1777696865804_0.8840187054589106","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aethex.os/webrtc","version":"1.0.1","keywords":["aethex","webrtc","voice","video","calls","screen-share","metaverse","p2p"],"author":{"name":"AeThex Corporation"},"license":"MIT","_id":"@aethex.os/webrtc@1.0.1","maintainers":[{"name":"mrpiglr","email":"mrpiglr@aethex.dev"}],"homepage":"https://aethex.dev","bugs":{"url":"https://github.com/AeThex-Corporation/AeThex-OS/issues"},"dist":{"shasum":"8d836e56117f71eae9ab70852d95bbc0b39b908a","tarball":"https://registry.npmjs.org/@aethex.os/webrtc/-/webrtc-1.0.1.tgz","fileCount":10,"integrity":"sha512-dFeb3NNCoxSQLL2ynyOZAnwGMK0YwUgEBHMcN1c3a98XU0YJL1hfiQyA45EndaintvHZq1Yn8Rbc0fzWHJwCYw==","signatures":[{"sig":"MEUCIQD3qLALDL3/eLkQQVnfXU/OeK6RBWEh07c0eDKOlq317gIgIdC875yyG1c6xQq6jgPaUBG8SwkdXzTEX3gxfejQUSY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19628},"main":"lib/index.js","types":"lib/index.d.ts","browser":true,"engines":{"node":">=18.0.0"},"gitHead":"b094d5c032765a30612c2348ce0356d3a50d9feb","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc"},"_npmUser":{"name":"mrpiglr","email":"mrpiglr@aethex.dev"},"repository":{"url":"git+https://github.com/AeThex-Corporation/AeThex-OS.git","type":"git","directory":"packages/aethex-webrtc"},"_npmVersion":"11.12.1","description":"AeThex WebRTC — voice/video calls, screen sharing, and voice activity detection with socket.io signaling","directories":{},"_nodeVersion":"22.22.0","dependencies":{"socket.io-client":"^4.7.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/webrtc_1.0.1_1777932464836_0.49177290036437493","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aethex.os/webrtc","version":"1.0.2","description":"AeThex WebRTC — voice/video calls, screen sharing, and voice activity detection with socket.io signaling","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest"},"keywords":["aethex","webrtc","voice","video","calls","screen-share","metaverse","p2p"],"author":{"name":"AeThex Corporation"},"license":"MIT","homepage":"https://aethex.dev/docs","repository":{"type":"git","url":"git+https://git.aethex.tech/Labs/os.git","directory":"packages/aethex-webrtc"},"dependencies":{"socket.io-client":"^4.7.0"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.3.0"},"engines":{"node":">=18.0.0"},"browser":true,"bugs":{"url":"https://git.aethex.tech/Labs/os/issues"},"_id":"@aethex.os/webrtc@1.0.2","gitHead":"6c77abd6440deb925777f64998d4c67a398236e0","_nodeVersion":"22.22.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-WiG+7snR3ZDbxFcpmYAmsOQo8tkMpATcEosL6NeNpy/Bdxjt1O4d8NVXDUOmr1YPQmbMYmy+jpnLKQye56bBPA==","shasum":"ee3968fa147056866d928ce54d9fffa7b3813c60","tarball":"https://registry.npmjs.org/@aethex.os/webrtc/-/webrtc-1.0.2.tgz","fileCount":10,"unpackedSize":19690,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHBeR1lebHtV8GDFAVK1C7nFiWzoVdqM+O+ZVWVQc8KCAiEA4NofkORkTDuScpDmn8Yegaw7a5JPd4HYQgVg5d1uqCs="}]},"_npmUser":{"name":"mrpiglr","email":"mrpiglr@aethex.dev"},"directories":{},"maintainers":[{"name":"mrpiglr","email":"mrpiglr@aethex.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webrtc_1.0.2_1783400216757_0.3600457574125904"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T04:41:05.698Z","modified":"2026-07-07T04:56:57.037Z","1.0.0":"2026-05-02T04:41:05.957Z","1.0.1":"2026-05-04T22:07:44.980Z","1.0.2":"2026-07-07T04:56:56.905Z"},"bugs":{"url":"https://git.aethex.tech/Labs/os/issues"},"author":{"name":"AeThex Corporation"},"license":"MIT","homepage":"https://aethex.dev/docs","keywords":["aethex","webrtc","voice","video","calls","screen-share","metaverse","p2p"],"repository":{"type":"git","url":"git+https://git.aethex.tech/Labs/os.git","directory":"packages/aethex-webrtc"},"description":"AeThex WebRTC — voice/video calls, screen sharing, and voice activity detection with socket.io signaling","maintainers":[{"name":"mrpiglr","email":"mrpiglr@aethex.dev"}],"readme":"# @aethex.os/webrtc\n\nWebRTC manager for voice/video calls, screen sharing, and voice activity detection. Uses socket.io for signaling — drop it in next to your existing socket server.\n\n## Install\n\n```bash\nnpm install @aethex.os/webrtc\n```\n\n## Usage\n\n### Start a call\n\n```ts\nimport { WebRTCManager } from '@aethex.os/webrtc';\n\nconst rtc = new WebRTCManager('https://your-signaling-server.com');\n\n// Called when remote stream arrives\nrtc.onRemoteTrack = (peerId, stream) => {\n  videoElement.srcObject = stream;\n};\n\n// Start voice call\nawait rtc.initiateCall('peer_456', { audio: true, video: false });\n```\n\n### Answer a call\n\nIncoming calls are handled automatically via socket events. Attach handlers before connecting:\n\n```ts\nrtc.onRemoteTrack = (peerId, stream) => {\n  remoteAudio.srcObject = stream;\n};\n\nrtc.onPeerDisconnected = (peerId) => {\n  console.log(`${peerId} left`);\n};\n```\n\n### Controls\n\n```ts\nrtc.toggleAudio(false);   // mute\nrtc.toggleVideo(false);   // camera off\n\nawait rtc.startScreenShare('peer_456');\nawait rtc.stopScreenShare('peer_456');\n\nrtc.endCall('peer_456');\n```\n\n### Voice Activity Detection\n\n```ts\nawait rtc.initializeLocalStream({ audio: true, video: false });\n\nsetInterval(() => {\n  if (rtc.isSpeaking()) {\n    showSpeakingIndicator();\n  }\n}, 100);\n```\n\n### Custom ICE servers\n\n```ts\nconst rtc = new WebRTCManager('https://signaling.example.com', {\n  iceServers: [\n    { urls: 'stun:stun.example.com' },\n    { urls: 'turn:turn.example.com', username: 'user', credential: 'pass' },\n  ],\n});\n```\n\n### Cleanup\n\n```ts\nrtc.destroy(); // closes all connections, stops media, disconnects socket\n```\n\n## Signaling protocol\n\nYour socket server needs to handle these events:\n\n| Event | Direction | Payload |\n|---|---|---|\n| `call:offer` | client → server → peer | `{ to, offer }` |\n| `call:answer` | client → server → peer | `{ to, answer }` |\n| `call:ice-candidate` | client → server → peer | `{ to, candidate }` |\n| `call:end` | client → server → peer | `{ to }` |\n\n## Part of the @aethex.os ecosystem\n\nSee [@aethex.os/core](https://npmjs.com/package/@aethex.os/core) for the full package list.\n","readmeFilename":"README.md"}