{"id":19003393,"url":"https://github.com/lucadiba/switchbot-client","last_synced_at":"2025-04-22T18:14:59.869Z","repository":{"id":62464914,"uuid":"559752639","full_name":"LucaDiba/switchbot-client","owner":"LucaDiba","description":"A Node.js client for SwitchBot 1.1 APIs with built-in TypeScript types.","archived":false,"fork":false,"pushed_at":"2025-04-14T02:08:40.000Z","size":6687,"stargazers_count":2,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T09:00:24.892Z","etag":null,"topics":["switchbot","switchbot-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/LucaDiba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-10-31T02:36:36.000Z","updated_at":"2025-03-25T07:01:45.000Z","dependencies_parsed_at":"2023-02-19T14:45:55.331Z","dependency_job_id":"cd72f9f1-7bad-4dec-bd7d-bcdbe3ede474","html_url":"https://github.com/LucaDiba/switchbot-client","commit_stats":{"total_commits":93,"total_committers":3,"mean_commits":31.0,"dds":"0.17204301075268813","last_synced_commit":"7871df52a721c85e69a86c8907ce799ce58f6e72"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaDiba%2Fswitchbot-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaDiba%2Fswitchbot-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaDiba%2Fswitchbot-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaDiba%2Fswitchbot-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucaDiba","download_url":"https://codeload.github.com/LucaDiba/switchbot-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250296202,"owners_count":21407037,"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":["switchbot","switchbot-api"],"created_at":"2024-11-08T18:18:55.250Z","updated_at":"2025-04-22T18:14:59.846Z","avatar_url":"https://github.com/LucaDiba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSwitchBot client\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003e⚠️ This package is in beta ⚠️\u003c/h2\u003e\n\u003cp\u003e\n  \u003cimg alt=\"TypeScript\" src=\"https://img.shields.io/badge/TypeScript-007ACC?logo=typescript\u0026logoColor=white\" /\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@lucadiba/switchbot-client\"\u003e\n    \u003cimg alt=\"NPM package\" src=\"https://img.shields.io/npm/v/@lucadiba/switchbot-client?color=blue\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LucaDiba/switchbot-client/actions/workflows/ci.yml\"\u003e\n    \u003cimg alt=\"CI build\" src=\"https://github.com/LucaDiba/switchbot-client/actions/workflows/ci.yml/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"Code coverage\" src=\"https://codecov.io/gh/LucaDiba/switchbot-client/branch/main/graph/badge.svg?token=RvIg6LPcvm\" /\u003e\n  \u003ca href=\"https://github.com/LucaDiba/switchbot-client/graphs/commit-activity\"\u003e\n    \u003cimg alt=\"Maintained\" src=\"https://img.shields.io/badge/maintained-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://lucadiba.github.io/switchbot-client/modules/SwitchBot.html\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LucaDiba/switchbot-client/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/github/license/LucaDiba/switchbot-client\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e A JavaScript client for SwitchBot 1.1 APIs with built-in TypeScript types.\u003cbr /\u003e\n\u003e This package supports both ESM and CommonJS.\n\n## Installation\n\nInstall the package using your preferred package manager:\n\n```sh\nnpm install @lucadiba/switchbot-client\n```\n\n## Usage\n\n### Initialize the client\n\nImport the package in your application.\n\n```typescript\nimport SwitchBot from \"@lucadiba/switchbot-client\";\n```\n\nInitialize the client with your open token and secret key. You can [find these values in the SwitchBot app](https://support.switch-bot.com/hc/en-us/articles/12822710195351-How-to-obtain-a-Token).\n\n```typescript\nconst switchbot = new SwitchBot({\n  openToken: \"openToken\",\n  secretKey: \"secretKey\",\n});\n```\n\n### Device\n\nTo interact with a device, you need to know its ID. You can find it in the SwitchBot app or by calling the `devices` method.\n\n```typescript\nconst devices = await switchbot.devices();\n// [{\n//   deviceId: \"deviceId\",\n//   ...\n// }]\n```\n\nThen, you can interact with the device.\n\n```typescript\n// Press SwitchBot Bot\nswitchbot.bot(\"deviceId\").press();\n```\n\n### Scene\n\n```typescript\n// Execute SwitchBot Scene\nswitchbot.scene(\"sceneId\").execute();\n```\n\n## Support\n\nThe following devices are supported:\n\n- Blind Tilt\n- Bot\n- Ceiling Light\n- Ceiling Light Pro\n- Color Bulb\n- Contact Sensor\n- Curtain\n- Curtain 3\n- Hub\n- Hub 2\n- Hub Plus\n- Hub Mini\n- Humidifier\n- Indoor Cam\n- Keypad\n- Keypad Touch\n- Lock\n- Meter\n- Meter Plus\n- Outdoor meter\n- Motion Sensor\n- Pan/Tilt Cam\n- Pan/Tilt Cam 2K\n- Plug\n- Plug Mini (US)\n- Plug Mini (JP)\n- Remote\n- Robot Vacuum Cleaner S1\n- Robot Vacuum Cleaner S1 Plus\n- Strip Light\n- [📘 Full documentation](https://lucadiba.github.io/switchbot-client/modules/SwitchBot.html)\n\nThe following devices are currently not supported:\n\n- Battery Circulator Fan\n- Virtual infrared remote devices\n\n## Author\n\n👤 **Luca Dibattista**\n\n- Website: https://lucadibattista.it\n- Github: [@LucaDiba](https://github.com/LucaDiba)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003e\nFeel free to check [issues page](https://github.com/LucaDiba/switchbot-client/issues).\u003cbr /\u003e\nPlease run `npx changeset` and follow the instructions to create a new changeset before opening a pull request.\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2022 [Luca Dibattista](https://github.com/LucaDiba).\u003cbr /\u003e\nThis project is [MIT](https://github.com/LucaDiba/switchbot-client/blob/main/LICENSE) licensed.\n\n---\n\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucadiba%2Fswitchbot-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucadiba%2Fswitchbot-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucadiba%2Fswitchbot-client/lists"}