# codetheweb/tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.

Repository: https://github.com/codetheweb/tuyapi
Canonical: https://ross.abutalabs.com/products/tuyapi
Language: JavaScript
License: MIT
License Family: permissive
Topics: iot, tuya, nodejs, smarthome, local
Last push: 2025-10-09T04:41:51+00:00

## Health v2 (maintenance only)
Score: 44/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 46, release rhythm 8, longevity 100
- inputs: {"age_days": 3234, "days_push": 328, "days_rel": 604, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2319, forks 353 (observed 2026-08-28T04:06:37.003038+00:00)

## What it is
TuyAPI is a Node.js library that provides an easy-to-use API for communicating with smart devices built on Tuya's protocol, such as plugs, switches, and lights sold under many brand names. It supports discovering devices on the local network, connecting, and reading or setting their data points either via events or synchronous calls, largely without depending on Tuya's cloud.

## Use cases
- control Tuya smart plugs and switches from Node.js
- communicate with Tuya devices over the local network instead of the cloud
- read the current status of Tuya-branded smart home devices
- toggle smart home devices programmatically in automation scripts
- build custom integrations for Tuya-compatible IoT devices
- work with devices that respond on port 6668 or work with the TuyaSmart app

## When to choose
- your project is in JavaScript/Node.js and talks to Tuya-compatible hardware
- you want low-latency local control of devices without routing through Tuya's cloud
- you need an event-driven or promise-based API to get and set device data points
- you are building a custom smart home integration, bridge, or automation tool

## When to avoid
- your devices are not Tuya-based or do not work with the TuyaSmart app
- you need full official cloud features like scheduling, scenes, or device provisioning
- you want a polished end-user app rather than a developer library
- your stack is not Node.js and you cannot integrate a JavaScript dependency

## Facets
- artifact type: library
- maturity: stable
- function: iot, sdk
- domain: iot
- platform: -
- tags: tuya, smart-home, home-automation, local-control, device-protocol, smart-plugs, smart-switches, javascript-library, event-based-api, automation, nodejs

## Member repositories
- codetheweb/tuyapi (main) score 44

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.003038+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:51.040984+00:00, confidence not recorded.
  - readme: https://github.com/codetheweb/tuyapi (fetched 2026-08-28T04:06:37.003038+00:00, sha 049ba12305ea)
  - registry_npm: https://registry.npmjs.org/tuyapi (fetched 2026-08-29T10:19:14.801828+00:00, sha fcd571298ddf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
