React Native API
Find the client API for configuration, updates, targeting, progress, and diagnostics.
Find an API
Use this reference when implementing a specific client behavior. For the full app integration and first OTA, start with app integration.
Configure the app
Start with HotUpdater.init, which configures the update server and its
client plugins, such as the Insights and Remote Config
plugins, and returns the app's HotUpdater instance. Call it once at the top
level of a module and export the instance, hotUpdater. The other APIs on
this page are methods of that instance, except the useHotUpdaterStore hook
and the plugins, which @hot-updater/react-native exports:
import { HotUpdater } from "@hot-updater/react-native";
export const hotUpdater = HotUpdater.init({
baseURL: "<your-update-server-url>",
});| API | Use it to |
|---|---|
HotUpdater.init | Configure the update server, request settings, and client plugins once, and get the app's instance. |
wrap | Check for an update when the app's root mounts, with an optional loading screen, and reload for a forced update. |
Check, stage, and reload
For your own check timing instead of wrap, use these methods:
| API | Use it to |
|---|---|
checkForUpdate | Select a compatible transition from the Release Catalog. |
updateBundle | Stage a transition; prefer the helper returned by checkForUpdate. |
reload | Start the staged update immediately. |
setReloadBehavior | Choose Android process restart, React Native reload, or a custom host handler. |
A staged update can change the selected ID before its code runs. See custom update flows for check timing and UI, and how updates work for the delivery lifecycle.
Target channels and cohorts
| API | Use it to |
|---|---|
getChannel | Read the effective channel. |
getDefaultChannel | Read the channel embedded in the native build. |
isChannelSwitched | Inspect whether a runtime channel switch is active. |
resetChannel | Clear OTA state and restore the built-in bundle selection. |
getCohort | Read the persisted rollout cohort. |
setCohort | Override the cohort for future checks. |
For workflows, see runtime channel switching and rollout and cohorts.
Observe progress
| API | Use it to |
|---|---|
useHotUpdaterStore | Subscribe to progress in React UI. |
addListener | Handle raw progress events with an unsubscribe function. |
isUpdateDownloaded | Read download readiness for the current app session. |
Diagnose an installation
| API | Use it to |
|---|---|
getAppVersion | Read the native app version. |
getBundleId | Read the selected update ID shown in the Console. |
notifyAppReady | Read the native launch outcome and applied or recovered transition IDs. |
getActiveUpdateState | Inspect active and stable selections, artifact IDs, and pending verification. |
getInstallId | Identify an installation in Insights or a support report. |
getCrashHistory | Inspect artifacts rejected after a crash. |
clearCrashHistory | Allow the device to retry previously rejected artifacts. |
See Insights for reporting limits and automatic rollback for recovery behavior.
Extend with plugins
Plugins go in init's plugins, and each plugin's API is on the
instance init returns,
such as hotUpdater.remoteConfig:
| API | Use it to |
|---|---|
insights | Report launches, downloads, applies, recoveries, and update failures to Insights, optionally with your app's user ID. |
remoteConfig | Read values your server's Remote Config picks for the device, synchronously, with in-app defaults. |
defineClientPlugin | Write a plugin that observes the update lifecycle, sends data to your server, and adds an API to the instance. Plugins import it from @hot-updater/protocol. |