Documentation

Ship OTA updates to your React Native app. Guides for installation, concepts, CLI, and SDK integration.

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.js or your earliest startup file
  • passing the runtime environment from 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 as production, staging, or development
  • enabled: defaults to true; set false to keep Bundle Drop mounted but inactive for that runtime
  • channelName: initial channel for the current app process
  • policy: manual, on-next-launch, or immediate
  • onStatusUpdate: callback for human-readable status updates
  • checkOnly: 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

index.js
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:

  1. initializes the runtime service
  2. loads local update state
  3. handles rollback and commit safeguards
  4. 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