BundleDrop.init
What BundleDrop.init Is
BundleDrop.init is the required startup entrypoint for the Bundle Drop runtime.
Call it once when the app starts. It sets the runtime environment and initial channel for the current app process, hydrates local OTA state, and optionally runs the startup update flow based on your selected policy.
When to Use It
Use BundleDrop.init in every app that uses Bundle Drop.
That usually means:
- calling it from
index.jsor your earliest startup file - passing the runtime
environmentfrom your own app config - deciding whether OTA should be enabled for that runtime
- choosing the startup policy that fits your app
If you want custom buttons, prompts, or settings screens, still call BundleDrop.init once and then use useBundleDrop for the UI layer.
Main Options
environment: required runtime label such asproduction,staging, ordevelopmentenabled: defaults totrue; setfalseto keep Bundle Drop mounted but inactive for that runtimechannelName: initial channel for the current app processpolicy:manual,on-next-launch, orimmediateonStatusUpdate: callback for human-readable status updatescheckOnly: resolve on startup without downloading or applying
Return Shape
BundleDrop.init(...) returns:
void
It initializes the singleton runtime synchronously and handles any async startup work internally.
Typical Usage
1import { BundleDrop } from "@gfean/react-native-bundle-drop";
2
3BundleDrop.init({
4 enabled: !__DEV__,
5 environment: __DEV__ ? "development" : "production",
6 channelName: "General",
7 policy: __DEV__ ? "manual" : "on-next-launch",
8 onStatusUpdate: (msg) => console.log("[OTA]", msg),
9});How It Works in Practice
At a high level, BundleDrop.init:
- initializes the runtime service
- loads local update state
- handles rollback and commit safeguards
- if enabled, follows the selected Update Policies startup behavior
That makes it the right choice when you want one runtime source of truth for update state and channel selection.
Best Fit
BundleDrop.init is best for:
- every app using Bundle Drop
- automated startup checks and downloads
- teams that want a single runtime controller before rendering OTA-aware UI
Alternative
If you want manual control over checking, downloading, and applying updates from your own interface, use useBundleDrop after startup init.
Related Docs
- For lower-level direct functions, see Runtime APIs.
- For policy behavior, see Update Policies.
- For manual UI flows, see useBundleDrop.
- For SDK overview, see SDK Integration.