Interface: OtaConfig
Defined in: config.ts:19
Configuration passed to DashOtaProvider.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
appVersion | string | app marketing version (for targetAppVersions matching). | config.ts:23 |
attestor? | IntegrityAttestor | - | config.ts:87 |
autoCheckOnLaunch? | boolean | check for an update automatically on launch (default true). | config.ts:32 |
autoMarkHealthyMs? | number | Auto-promote the running bundle to last-known-good this many ms after a successful mount, so hosts don't have to wire markHealthy() by hand. Omit (default) to keep it manual — the safest choice, since calling markHealthy() only after your real first screen renders gives the crash-loop breaker its full protection. A value like 4000 is a reasonable plug-and-play default for simple apps. | config.ts:63 |
autoStage? | boolean | automatically stage + schedule an apply when an update is found (default true). | config.ts:34 |
checkOnAppForeground? | boolean | re-run a check when the app returns to the foreground (default false). | config.ts:65 |
enabled? | boolean | Master switch (default true). When false, the provider mounts but performs no OTA activity — no enroll, check, download, or apply — and reports status disabled. Use it to withhold OTA from a runtime you don't trust (e.g. a jailbroken / rooted device) so it keeps running only the store-shipped binary. | config.ts:30 |
getEnrollToken? | () => Promise<string | undefined> | returns the app's authenticated session token, attached to enroll (ties the device key to a user). | config.ts:84 |
logger? | OtaLogger | - | config.ts:85 |
mandatory? | "auto-download" | "announce" | What to do about a release published with mandatory: true (default 'auto-download'). - 'auto-download' — ignore autoStage: false and download it immediately, so the user only ever has to press Restart. Combined with OtaUi.blocking (set for every mandatory update) this is the force-update flow: the host refuses to dismiss the UI, the bundle arrives on its own. - 'announce' — treat it like any optional update; only blocking marks it as required. | config.ts:44 |
onStatusChange? | (status) => void | observability hook fired on every lifecycle status transition. | config.ts:67 |
serverUrlOverride? | string | override the native-embedded server URL. Tests and local development only — a production build must take the URL from native, where JS cannot reach it. | config.ts:70 |
storage | OtaStorage | persistence for the install id (the signing key lives in the hardware Keystore / Enclave). | config.ts:21 |
storeUrl? | string | Your app's store listing, surfaced as NativeVersionPolicy.storeUrl on the force-update gate. Set this. The policy in the /check response is not covered by the manifest signature, so a storeUrl coming from the server is attacker-controllable — and the gate that opens it is a blocking, full-screen prompt. The client therefore never passes the server's value through: without this, nativePolicy.storeUrl is undefined and your gate has no link. Must be https://, market:// or itms-apps://; anything else is refused and logged. | config.ts:82 |
transport? | TransportSecurity | - | config.ts:86 |
uiCopy? | Partial<Record<"available" | "working" | "ready" | "error", Partial<OtaUiPhaseCopy>>> | Override any of the strings in OtaUi (per phase: title, description, cta). Partial and per-phase-partial: anything omitted keeps the built-in copy. {version} inside a string is replaced with the relevant bundle version. Use it for your own tone or localization. Example uiCopy: { ready: { title: 'Restart to finish updating', cta: 'Restart now' } } | config.ts:55 |