Skip to content

@mega-yfue/eufy-sdk / SessionExpiredError

Class: SessionExpiredError ​

Thrown when a persisted/expired session is rejected (401). Re-login to recover.

It carries the rate the client has already worked out for replacing a rejected token, because the rejection is where that rate stops being the client's alone: a login driven from here spends the same session the client's own recovery would have, and repeated logins are what makes an account start demanding captchas. retryAfterMs is how long the next replacement is barred for, and contended whether this rejection landed inside that bar — the shape repeated displacement has.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new SessionExpiredError(message, opts?): SessionExpiredError;

Parameters ​

message ​

string

opts? ​
contended? ​

boolean

retryAfterMs? ​

number

Returns ​

SessionExpiredError

Overrides ​

Error.constructor

Properties ​

contended ​

ts
readonly contended: boolean;

Whether this rejection landed inside that bar — a token replaced recently and rejected again since.

That is the shape displacement by another client signed in on this account has, where replacing the token again only trades one login for another. It is not proof of one, since a cloud refusing to re-issue the session looks the same.


retryAfterMs ​

ts
readonly retryAfterMs: number;

How long the next session replacement is barred for, in milliseconds; 0 when nothing bars one now.

The remainder of the client's own hold-off, which doubles per consecutive replacement and is capped — and which every replacement extends, whether the client spent it or a login made on this error did.

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.