example-app

QiPort example app

A minimal, complete TypeScript client for the QiPort API, plus one program that uses it. No npm dependencies. Node 22 built-ins only (fetch, URL, AbortSignal, TextDecoder). Every file below is served as plain text — click to read it in the browser.

qiport-client.tstypescript · 37 kB
The client. Copy this into your project. Token caching with early refresh, one in-flight token request, single re-auth on 401, retry with full jitter on 429/5xx, tolerant envelope readers, and typed errors. BUILDING endpoints throw a named QiPortFeatureUnavailableError instead of a bare 404.
find-tuya-devices.tstypescript · 10 kB
Lists devices, marks the likely Tuya ones, prints each device's capabilities and current values with unit, safety class and whether a write grant would be required.
README.mdmarkdown · 8.7 kB
How to run it, what it does, what it cannot do and why, and how to use the client in your own code.

Run it

Node 22.18 or newer runs TypeScript directly — no build step, no tsc, no ts-node:

export QIPORT_CLIENT_ID='your-client-id'
export QIPORT_CLIENT_SECRET='your-client-secret'

node find-tuya-devices.ts

On Node 22.6–22.17, enable type stripping explicitly with node --experimental-strip-types find-tuya-devices.ts.

What this program cannot do

It cannot trigger a Zigbee join / permit-join on the SLZB-06P10, provision or claim hardware, or turn a relay or valve on or off. Those are not missing features of the program — pairing and provisioning are Not built and the commands endpoint is Building, written but not deployed. It reports on devices that are already in the QiPort registry.

Read the guide first

The client makes no assumptions about the host beyond the paths documented in the integration guide. Start there, then copy qiport-client.ts rather than writing another one.

QiPort — EU-hosted IoT device cloud
integration guide · llms.txt · ai-integration-guide.md · openapi.yaml
API api.qiport.eu · Site qiport.eu