Skip to content

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

Class: HmacSigner ​

The real TuyaSigner: sign = HMAC-SHA256(K, preimage) as lowercase hex.

Uses TUYA_SIGN_K by default — no configuration required. The env var TUYA_SIGN_KEY overrides the built-in key (for custom builds); an explicit constructor argument takes precedence over both. Verified: reproduces the captured smartlife.p.time.get sign 97a78b35…a7f8c84.

Implements ​

Constructors ​

Constructor ​

ts
new HmacSigner(key?): HmacSigner;

Parameters ​

key? ​

string

Returns ​

HmacSigner

Methods ​

sign() ​

ts
sign(preimage): string;

Parameters ​

preimage ​

string

Returns ​

string

Implementation of ​

TuyaSigner.sign

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.