eufy-mega / client/eufy-mega / EufyMegaOptions
Interface: EufyMegaOptions
Extends
MegaClientConfig
Properties
appName?
optional appName?: string;Inherited from
MegaClientConfig.appNameappVersion?
optional appVersion?: string;Inherited from
MegaClientConfig.appVersionautoRealtime?
optional autoRealtime?: boolean;Auto-manage connectivity (default true). When on, a successful EufyMega.login brings up the always-on event channels itself — FCM push + secure MQTT (if the account has appliances) — and eagerly warms P2P only for wired stations (HomeBases / mains cameras). Battery cameras stay detached until a command / stream / event pre-warm needs them, and idle-detach afterwards. The host calls no connect* — connectivity is transport-agnostic. Set false to manage nothing automatically (advanced/testing).
cacheTtlMs?
optional cacheTtlMs?: number;Read-through cache freshness window in ms (default 15000). A getProperty/getProperties read of a value older than this schedules ONE coalesced background refresh and returns the last-known value immediately; realtime (push/P2P) updates keep values fresh so a live device rarely refetches.
countryCode?
optional countryCode?: string;Two-letter account country code (e.g. "GB", "US", "DE"). Routes the region.
Inherited from
MegaClientConfig.countryCodeemail
email: string;Inherited from
MegaClientConfig.emailffmpegLogLevel?
optional ffmpegLogLevel?:
| "debug"
| "info"
| "error"
| "quiet"
| "panic"
| "fatal"
| "warning"
| "verbose"
| "trace";ffmpeg's own -loglevel for the media paths that shell out to it (snapshot / record / WebRTC container). Default "error" (quiet). Raise it (e.g. "trace") to diagnose a failing decode/mux; ffmpeg's stderr is then forwarded to the EufyMegaOptions.logger as [ffmpeg] debug lines — so you also need a logger that shows debug. Independent of the SDK's own log level.
localAddresses?
optional localAddresses?: Record<string, string>;LAN address overrides for direct P2P, keyed by parent-station serial → host or host:port. The SDK normally derives a station's LAN address from its device record; supply this when the record's IP is wrong/blocked (AP isolation, a stale ip_addr) and you know the real LAN address.
logger?
optional logger?: Logger;Diagnostics sink. Omit for silence; pass a Logger (or new ConsoleLogger()) to see logs.
Inherited from
MegaClientConfig.loggeropenudid?
optional openudid?: string;Stable per-install device id (the auth token binds to it). Derived from email if absent.
Inherited from
MegaClientConfig.openudidosVersion?
optional osVersion?: string;OS version string reported in headers.
Inherited from
MegaClientConfig.osVersionp2pIdleMs?
optional p2pIdleMs?: number;Idle window in ms before an on-demand P2P session to a battery station is closed so the device can sleep (default 300000 = 5 min). Wired stations stay persistent.
password
password: string;Inherited from
MegaClientConfig.passwordphoneModel?
optional phoneModel?: string;Phone model reported to the cloud. Give this client its OWN distinct value (e.g. "eufy-mega-client") so it appears as a separate device in your eufy account + 2FA/trust list, instead of impersonating a real phone.
Inherited from
MegaClientConfig.phoneModelpollMs?
optional pollMs?: number;How often to re-read the cloud device list and emit a semantic event for each param that changed (default 600000 = 10 min). Set 0 to disable polling entirely.
The default is paced to the data rather than to a host's refresh appetite — see the device's params for how slowly the cloud actually refreshes them. Polling faster costs requests without seeing anything sooner.
This channel carries the slow-moving state that has no push of its own (a battery level; a sensor that only reports to the cloud). Fast state — motion, doorbell, contact, lock — arrives over push/P2P/MQTT and is unaffected by this setting.
prewarmEvents?
optional prewarmEvents?: keyof DeviceEventMap[];Which semantic events pre-warm P2P — typed to the semantic event names (DeviceEventMap keys), so the list autocompletes and a typo won't compile. Default: ["doorbellPress", "personDetected", "petDetection", "packageDelivered"] — a doorbell ring plus the high-intent AI detections (human / animal / object), all rare + likely to prompt a look. Raw motion is deliberately NOT a default (a battery camera sees it constantly, which would defeat the idle-detach); add it only for a wired camera. Set your own list to override.
prewarmMs?
optional prewarmMs?: number;Speculative pre-warm window in ms after a high-intent event (default 28000). On a doorbell ring the SDK opens the camera's P2P session so a tap-to-view / talkback starts instantly; if nothing attaches within the window the session idle-detaches.
pushStore?
optional pushStore?: FcmStore;Persist FCM push credentials + seen ids across runs (default: in-memory).
region?
optional region?: RegionShard;Force a region shard, skipping estimate_domain.
Inherited from
MegaClientConfig.regionstateSnapshotMs?
optional stateSnapshotMs?: number;How long EufyMega.getDevice waits (ms, default 4000) for a device whose state exists ONLY on its realtime wire to make its first report, before resolving it.
Such a device has no pollable cloud state, and the typed read getters are gated on what it has actually reported — so one resolved before its first report has no readable state, and no later report can add the getters to it. A short wait buys a populated read surface. 0 disables the wait and accepts that reads appear only on a Device fetched after the first report. Devices with a cloud record never wait.
store?
optional store?: SessionStore;Persist + reuse the session (token + session key) across runs. Default: in-memory.
Inherited from
MegaClientConfig.store