{"id":28176204,"url":"https://github.com/ionorg/ion-sdk-js","last_synced_at":"2025-07-18T12:40:57.675Z","repository":{"id":39653374,"uuid":"261069185","full_name":"ionorg/ion-sdk-js","owner":"ionorg","description":"ion javascript sdk","archived":false,"fork":false,"pushed_at":"2023-03-27T21:39:15.000Z","size":1467,"stargazers_count":104,"open_issues_count":33,"forks_count":73,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-15T16:49:22.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ionorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"open_collective":"pion-ion"}},"created_at":"2020-05-04T03:08:01.000Z","updated_at":"2025-03-14T13:13:04.000Z","dependencies_parsed_at":"2024-06-20T15:52:54.007Z","dependency_job_id":null,"html_url":"https://github.com/ionorg/ion-sdk-js","commit_stats":null,"previous_names":["pion/ion-sdk-js"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionorg%2Fion-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionorg%2Fion-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionorg%2Fion-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionorg%2Fion-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ionorg","download_url":"https://codeload.github.com/ionorg/ion-sdk-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442813,"owners_count":22071878,"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":[],"created_at":"2025-05-16T00:16:22.691Z","updated_at":"2025-07-18T12:40:57.667Z","avatar_url":"https://github.com/ionorg.png","language":"JavaScript","funding_links":["https://opencollective.com/pion-ion"],"categories":[],"sub_categories":[],"readme":"# ion-sdk-js\n\nFrontend sdk for the Ion backend.\n\n## Installation\n\n`npm install ion-sdk-js`\n\n## Usage\n\n```ts\nimport { Client, LocalStream, RemoteStream } from 'ion-sdk-js';\nimport { IonSFUJSONRPCSignal } from 'ion-sdk-js/lib/signal/json-rpc-impl';\nconst signal = new IonSFUJSONRPCSignal(\"wss://ion-sfu:7000/ws\");\nconst client = new Client(signal);\nsignal.onopen = () =\u003e client.join(\"test session\", \"test uid\")\n\n// Setup handlers\nclient.ontrack = (track: MediaStreamTrack, stream: RemoteStream) =\u003e {\n    // mute a remote stream\n    stream.mute()\n    // unmute a remote stream\n    stream.unmute()\n\n    if (track.kind === \"video\") {\n         // prefer a layer\n         stream.preferLayer(\"low\" | \"medium\" | \"high\")\n    }\n});\n\n// Get a local stream\nconst local = await LocalStream.getUserMedia({\n    audio: true,\n    video: true,\n    simulcast: true, // enable simulcast\n});\n\n// Publish stream\nclient.publish(local);\n\n// mute local straem\nlocal.mute()\n\n// unmute local stream\nlocal.unmute()\n\n// create a datachannel\nconst dc = client.createDataChannel(\"data\")\ndc.onopen = () =\u003e dc.send(\"hello world\")\n\n// Close client connection\nclient.close();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionorg%2Fion-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionorg%2Fion-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionorg%2Fion-sdk-js/lists"}