{"id":51124367,"url":"https://github.com/tny-robotics/sdk-ts","last_synced_at":"2026-06-25T06:00:54.227Z","repository":{"id":362356718,"uuid":"1229992611","full_name":"TNY-Robotics/SDK-TS","owner":"TNY-Robotics","description":"Typescript SDK for TNY-Robotics robots","archived":false,"fork":false,"pushed_at":"2026-06-11T16:39:39.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T07:05:18.653Z","etag":null,"topics":["esp32","robot","robotics","sdk","websocket"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@tny-robotics/sdk","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/TNY-Robotics.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-05T15:16:41.000Z","updated_at":"2026-06-11T16:39:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TNY-Robotics/SDK-TS","commit_stats":null,"previous_names":["tny-robotics/sdk-ts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TNY-Robotics/SDK-TS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNY-Robotics%2FSDK-TS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNY-Robotics%2FSDK-TS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNY-Robotics%2FSDK-TS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNY-Robotics%2FSDK-TS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TNY-Robotics","download_url":"https://codeload.github.com/TNY-Robotics/SDK-TS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TNY-Robotics%2FSDK-TS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34761847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"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":["esp32","robot","robotics","sdk","websocket"],"created_at":"2026-06-25T06:00:53.175Z","updated_at":"2026-06-25T06:00:54.216Z","avatar_url":"https://github.com/TNY-Robotics.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# @tny-robotics/sdk\n\n[![npm version](https://img.shields.io/npm/v/@tny-robotics/sdk.svg?color=blue)](https://www.npmjs.com/package/@tny-robotics/sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n\n**The official TypeScript/JavaScript SDK for all TNY Robotics robots**\n\n[🌐 Website](https://tny-robotics.com/) • [📦 NPM Package](https://www.npmjs.com/package/@tny-robotics/sdk) • [💬 Discord](https://discord.gg/XGABkx5A4y)\n\n\u003c/div\u003e\n\n---\n\n## 🚀 Overview\n\n`@tny-robotics/sdk` provides a clean, promise-based API to communicate with your TNY Robotics robot.\n\nIt handles all the complex binary WebSocket framing under the hood, letting you focus on building amazing apps, dashboards, or block-based programming interfaces (like [TNY-Coder](https://github.com/TNY-Robotics/TNY-Coder)).\n\n### ✨ Features\n* **Universal (Isomorphic):** Works flawlessly in Node.js (Electron, backends) and in the Browser (Nuxt, Vue, React).\n* **Fully Typed:** Written in TypeScript for perfect auto-completion and Developer Experience (DX).\n* **Modular:** Access robot features cleanly through dedicated modules (`robot.system`, `robot.joint`, `robot.power`, etc.).\n\u003c!-- * **Smart Streaming:** Built-in subscription manager for sensor streams (IMU, Lidar) to optimize bandwidth. --\u003e\n---\n\n## 📦 Installation\n\nInstall the package using your favorite package manager:\n\n```bash\nnpm install @tny-robotics/sdk\n# or\nyarn add @tny-robotics/sdk\n# or\npnpm add @tny-robotics/sdk\n```\n\n---\n\n## 💻 Quick Start\n\nHere is a simple example to connect to your TNY-360 and test the connection latency:\n\n```typescript\nimport { TNY360 } from '@tny-robotics/sdk';\n\nasync function main() {\n    console.log('Creating TNY-360 instance...');\n    // Replace with your robot's IP address\n    const robot = new TNY360('192.168.4.1');\n\n    try {\n        console.log('Connecting to TNY-360...');\n        await robot.connect();\n        console.log('Connected successfully!');\n    } catch (err) {\n        console.error('Connection error:', err);\n        return;\n    }\n\n    // Ping test\n    console.log('Sending pings...');\n    const start = Date.now();\n    for (let i = 0; i \u003c 10; i++) {\n        await robot.system.ping();\n    }\n    const end = Date.now();\n    \n    console.log(`Average response time: ${(end - start) / 10} ms.`);\n}\n\nmain();\n\n```\n\n---\n\n## 🧩 API Structure\n\nThe SDK is organized into intuitive modules. Here are some examples of what you can do:\n\n### System \u0026 Settings\n\n```typescript\n// Get robot statistics\nconst stats = await robot.system.getStats();\nconsole.log(`Temperature: ${stats.temp_c}°C, CPU0 Usage: ${stats.cpu_usage.core0}%`);\n\n// Change AutoLife mode\nimport { AutoLifeLevel } from '@tny-robotics/sdk';\nawait robot.system.setAutoLifeLevel(AutoLifeLevel.Safeguard);\n\n```\n\n### Motion \u0026 Joints\n\n```typescript\n// Set the front-right knee joint to 30 degrees\nawait robot.joint.setAngle(JointId.FrontRightKneePitch, 30 * (Math.PI / 180));\n\n// Get the current angle of the back-left hip roll joint\nconst curAngle = await robot.joint.getFeedbackAngle(JointId.BackLeftHipRoll);\nconsole.log(`Current Hip Roll Angle: ${curAngle * (180 / Math.PI)} degrees`);\n\n```\n\n### Sensors \u0026 Telemetry *(Coming soon)*\n\n```typescript\n// Subscribe to continuous Lidar distance updates\n// const unsubscribe = robot.laser.distance.subscribe((dist) =\u003e {\n//     console.log(`Lidar Distance: ${dist} meters`);\n// });\n\n```\n\n---\n\n## 🤝 Contributing\n\nThis SDK is part of the open-source TNY-Robotics ecosystem.\nFound a bug or want to add a new module? [Open an Issue](https://github.com/TNY-Robotics/SDK-TS/issues) or submit a Pull Request!\n\n## 📄 License\n\nThis SDK is licensed under the **MIT License**.\n*You are free to use it in your open-source or commercial applications, just include the copyright notice.*\n\nNeed help? Contact us [by mail](mailto:contact@tny-robotics.com) or join our [Discord](https://discord.gg/XGABkx5A4y).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftny-robotics%2Fsdk-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftny-robotics%2Fsdk-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftny-robotics%2Fsdk-ts/lists"}