{"id":29543918,"url":"https://github.com/anthonygregis/slobs-websocket-js","last_synced_at":"2026-05-19T19:15:13.241Z","repository":{"id":57363303,"uuid":"403605809","full_name":"anthonygregis/slobs-websocket-js","owner":"anthonygregis","description":"Streamlabs OBS websocket controller built on obs-websocket-js","archived":false,"fork":false,"pushed_at":"2021-09-09T14:06:29.000Z","size":442,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T14:58:49.339Z","etag":null,"topics":["obs","obs-studio","remote-control","slobs","slobs-websocket","streamlabs","websocket"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/slobs-websocket-js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthonygregis.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":"2021-09-06T11:59:40.000Z","updated_at":"2025-08-20T03:31:04.000Z","dependencies_parsed_at":"2022-09-26T16:32:13.764Z","dependency_job_id":null,"html_url":"https://github.com/anthonygregis/slobs-websocket-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/anthonygregis/slobs-websocket-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonygregis%2Fslobs-websocket-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonygregis%2Fslobs-websocket-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonygregis%2Fslobs-websocket-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonygregis%2Fslobs-websocket-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonygregis","download_url":"https://codeload.github.com/anthonygregis/slobs-websocket-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonygregis%2Fslobs-websocket-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33229264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["obs","obs-studio","remote-control","slobs","slobs-websocket","streamlabs","websocket"],"created_at":"2025-07-17T14:09:09.451Z","updated_at":"2026-05-19T19:15:13.225Z","avatar_url":"https://github.com/anthonygregis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **slobs-websocket-js**\n\nStreamlabs OBS websocket controller built on **[obs-websocket-js](https://github.com/obs-websocket-community-projects/obs-websocket-js)**\n\n# **Installation**\n\n```\n# NPM Install\nnpm install slobs-websocket-js\n\n# Yarn Install\nyarn add slobs-websocket-js\n\n```\n\n# **Usage**\n\nUntested in browser, currently supported in node.\n\n### **Node Import Methods**\n\n```javascript\n// CommonJS\nconst SLOBSWebSocket = require(\"slobs-websocket-js\");\n```\n\n### **Connecting**\n\n- Address is optional `default: 127.0.0.1`\n- Port is optional `default: 59650`\n- Path is optional `default: api`\n- Token is required\n  - Get this in `Settings -\u003e Remote Control`, click the QR Code and show details\n\n```javascript\nconst slobs = new SLOBSWebSocket();\n\nslobs.connect({\n  address: \"127.0.0.1\",\n  port: 59650,\n  path: \"api\",\n  token: \"l33t0k3n\",\n});\n```\n\n### **Requests**\n\nAll available requests can be found from checking the slobs-client [documentation](https://stream-labs.github.io/streamlabs-obs-api-docs/docs/index.html)\n\n- Method is required and can be found from [slobs-client](https://stream-labs.github.io/streamlabs-obs-api-docs/docs/index.html)\n- Params is required for specificing the service and for passing optional args\n\n```javascript\nslobs.send(\"method\", { params }); // Returns a promise\nslobs.sendCallback(\"method\", { params }, callback); // Callback returns (err, data)\n\n// Example\nslobs.send(\"makeSceneActive\", {\n  service: \"ScenesService\", // Service\n  args: [\"fakeSceneId-1235-12351\"], // Args (id)\n});\n```\n\n### **Events**\n\nWhen listening for events you currently need to include the service and method seperated by a period\n\n```javascript\nobs.on(\"Service.Method\", (data) =\u003e callback(data));\n```\n\n### **Errors**\n\nWebSocket errors besides the initial socket connection will be thrown as uncaught errors. All other errors can be caught using `.catch()` when sending request and by using the below example to catch any other error.\n\n```javascript\nobs.on(\"error\", (err) =\u003e {\n  console.error(\"socket error:\", err);\n});\n```\n\n# **Example Usage**\n\n```javascript\nconst SLOBSWebSocket = require(\"slobs-websocket-js\");\nconst slobs = new SLOBSWebSocket();\n\nslobs\n  .connect({\n    address: \"127.0.0.1\",\n    port: 59650,\n    path: \"api\",\n    token: \"l33t0ken\",\n  })\n  .then(() =\u003e {\n    console.log(\"Connected to SLOBS Websocket Server\");\n\n    return slobs.send(\"sceneSwitched\", {\n      resource: \"ScenesService\",\n    });\n  })\n  .then((data) =\u003e {\n    console.log(data);\n  })\n  .catch((err) =\u003e {\n    console.log(err);\n  });\n\nslobs.on(\"ScenesService.sceneSwitched\", (data) =\u003e {\n  console.log(`New Active Scene: ${data.name}`);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonygregis%2Fslobs-websocket-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonygregis%2Fslobs-websocket-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonygregis%2Fslobs-websocket-js/lists"}