Skip to content

@mega-yfue/eufy-sdk / secureTopic

Function: secureTopic() ​

ts
function secureTopic(device, leg): string;

Build a topic for a device: cmd/<prefix>/<model>/<sn>/<req|res>. leg is required — the two directions are one word apart and publishing to the wrong one fails silently. The prefix is derived by the module-local topicPrefix — eufy_home for clean-line devices, device.category elsewhere.

Parameters ​

device ​

EufyDevice

leg ​

"req" | "res"

Returns ​

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.