Skip to content

@mega-yfue/eufy-sdk / tuya / sendApiRequest

Function: sendApiRequest()

ts
function sendApiRequest<T>(params, opts?): Promise<TuyaEnvelope<T>>;

Form-encode a param map and POST it to api.json, returning the parsed TuyaEnvelope. The body is application/x-www-form-urlencoded (Tuya rejects JSON here).

Type Parameters

T

T = unknown

Parameters

params

Record<string, string>

opts?

SendOptions = {}

Returns

Promise<TuyaEnvelope<T>>

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.