{"id":20649537,"url":"https://github.com/leapmotion/leapjs-network","last_synced_at":"2025-10-19T11:40:43.048Z","repository":{"id":18829916,"uuid":"22045277","full_name":"leapmotion/leapjs-network","owner":"leapmotion","description":"Use WebRTC to send LeapMotion data p2p","archived":false,"fork":false,"pushed_at":"2014-12-11T09:04:40.000Z","size":577,"stargazers_count":36,"open_issues_count":2,"forks_count":6,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-17T12:16:17.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/leapmotion.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}},"created_at":"2014-07-20T22:48:13.000Z","updated_at":"2023-04-14T11:50:56.000Z","dependencies_parsed_at":"2022-09-25T05:50:23.816Z","dependency_job_id":null,"html_url":"https://github.com/leapmotion/leapjs-network","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leapmotion/leapjs-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2Fleapjs-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2Fleapjs-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2Fleapjs-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2Fleapjs-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leapmotion","download_url":"https://codeload.github.com/leapmotion/leapjs-network/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2Fleapjs-network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903034,"owners_count":26065786,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","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":[],"created_at":"2024-11-16T17:14:44.029Z","updated_at":"2025-10-08T06:53:04.087Z","avatar_url":"https://github.com/leapmotion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeapJS Network\n\n\nAllows LeapJS frame data to be streamed between peers via WebRTC.  Remote frames and local frames are merged and rendered together.\n\nSee `index.html` for [live demo](http://leapmotion.github.io/leapjs-network).\n\n```javascript\n  controller.use('networking', {\n    peer: new Peer({key: 'myapikey'}),  // WebRTC is handled by the PeerJS library \u0026 service\n    plotter: new LeapDataPlotter() // Optional - graphed debugging outputs\n  });\n\n  controller.plugins.networking.connect('my-session-id');\n```\n\nThe above code will cause the two newly connected peers to share all their frame data.\n\nFrame objects are given universal IDs, such that hand id `4` might become hand id `4-wkejgb`.  Each hand is also given a\n`userId` attribute.\n\nConnected peers without the Leap, (or without their controller) will see remote hands.\n\n\n![](https://s3.amazonaws.com/uploads.hipchat.com/28703/497504/6wKA7LD2agRg8Cl/Screenshot%202014-07-20%2013.43.19.png)\n\n\n### A note on performance\n\nCPU and network usage of this plugin are pretty good.  Being able to measure performance, both in terms of bandwidth and CPU usage, is extremely important when developing real-time applications, so check this yourself when used in your app.\n\nTo measure CPU usage (such as the data compression used here, or DOM manipulations), read this page: https://developer.leapmotion.com/leapjs/frame-loop\n\nTo measure network performance, check out the graphs included on `index.html`, as well as `chrome://webrtc-internals`. (va [SO post](http://stackoverflow.com/questions/24847640/how-to-measure-bandwidth-of-a-webrtc-data-channel))\n\n\n### Roadmap\n\nA few things could happen next:\n - More than two people on a page.  (this would require a relay server, or n^2 direct connections)\n - We could look for ways to reduce bandwidth usage, such as by sending frame diffs.\n - We could add a reliable data channel, for game-events to be synced.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapmotion%2Fleapjs-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleapmotion%2Fleapjs-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapmotion%2Fleapjs-network/lists"}