Skip to content

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

Function: buildApiParams()

ts
function buildApiParams(action, opts): Record<string, string>;

Build the full form param map for an action: fills the static env + per-install session fields + generated time/requestId, computes the sign preimage over the allowlisted subset, and appends the sign from the signer. Returns a flat Record<string,string> ready to form-encode.

The sign is the only step that needs a working TuyaSigner; a StubSigner throws here. Callers that only want to inspect the param shape can read BuildRequestOptions with a fake signer.

Parameters

action

TuyaAction

opts

BuildRequestOptions

Returns

Record<string, string>

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.