{"id":29101734,"url":"https://github.com/shiukaheng/webtopics","last_synced_at":"2026-04-15T13:33:44.395Z","repository":{"id":65745284,"uuid":"597255334","full_name":"shiukaheng/WebTopics","owner":"shiukaheng","description":"⚡️WebTopics ⁠— Real-time topics and services for web apps","archived":false,"fork":false,"pushed_at":"2023-03-28T21:45:21.000Z","size":540,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T21:08:04.002Z","etag":null,"topics":["real-time","ros2","socket-io","synchronization","visualization","websocket","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiukaheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-02-04T01:23:59.000Z","updated_at":"2023-04-25T21:17:08.000Z","dependencies_parsed_at":"2025-06-28T21:08:09.423Z","dependency_job_id":"70484e68-3cf8-4cfb-abd0-ce2b8462638f","html_url":"https://github.com/shiukaheng/WebTopics","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/shiukaheng/WebTopics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiukaheng%2FWebTopics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiukaheng%2FWebTopics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiukaheng%2FWebTopics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiukaheng%2FWebTopics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiukaheng","download_url":"https://codeload.github.com/shiukaheng/WebTopics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiukaheng%2FWebTopics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"last_error":"SSL_read: 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":["real-time","ros2","socket-io","synchronization","visualization","websocket","zod"],"created_at":"2025-06-28T21:08:01.824Z","updated_at":"2026-04-15T13:33:44.379Z","avatar_url":"https://github.com/shiukaheng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡️ WebTopics\n\nTyped pub / sub, request / responses for web apps using Socket.io and Zod, inspired by ROS.\n\n[[ Documentation ]](https://shiukaheng.github.io/WebTopics/)\n## Features\n### Typed and validated topics and services via Zod\n  ```typescript\n  const SensorTopic = createTopic(\"sensor\", z.object({\n    \"temperature\": z.number(),\n    \"humidity\": z.number()\n  }))\n  client.pub(SensorTopic, {temperature: 20, humidity: \"50%\"}) // Error: Expected number, received string\n  ```\n### Collaborative topics\n  ```typescript\n  client1.pub(channel, {a: \"1\"})\n  client2.pub(channel, {b: \"2\"}) // New state merged on old by default\n  client3.sub(channel, (value) =\u003e {\n    console.log(value) // {a: \"1\", b: \"2\"}\n  })\n  client2.pub(channel, {b: \"2\"}, true) // Or publishing as an overwrite\n  // client 3 receives: {b: \"2\"}\n  ```\n### Async service calls\n  ```typescript\n  const AdditionService = createService(\"add\", \n    // Request schema\n    z.object({\n      \"a\": z.number(),\n      \"b\": z.number()\n    }), \n    // Response schema\n    z.number()\n  )\n  ...\n\n  // Call service\n  const result = await client.req(AdditionService, someClientID, {a: 1, b: 2}) // Promise\u003cnumber\u003e\n  ```\n### Packagable channels for easy sharing between client and server\n  ```typescript\n  export const AdditionService = createService(\"add\", \n    z.object({\n      \"a\": z.number(),\n      \"b\": z.number()\n    }), \n    z.number()\n  )\n\n  export const SensorTopic = createTopic(\"sensor\", z.object({\n    \"temperature\": z.number(),\n    \"humidity\": z.number()\n  }))\n  ...\n\n  // Client and server can share the same channels from an external package\n  import {AdditionService, SensorTopic} from \"channels\"\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiukaheng%2Fwebtopics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiukaheng%2Fwebtopics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiukaheng%2Fwebtopics/lists"}