SDK Integration
Bundle Drop gives you two main SDK integration styles:
- BundleDrop.init for startup configuration and policy-driven behavior
- useBundleDrop for manual, UI-driven update workflows
- Runtime APIs for lower-level direct control
Runtime APIs
checkForUpdate(...): checks whether an update, rollback, or no-op decision is availabledownloadUpdate(...): downloads and stages an updateapplyUpdate(...): applies a staged update and reloads the appgetUpdateState(): returns whether a bundle exists locally and whether one is pending applygetAvailableChannels(): fetches public channel namesBundleDrop.setChannel(...): switches the active runtime channelsetUserProperty(...)andremoveUserProperty(...): manage user properties for targeted rollout
The detailed function behavior and return shapes are covered on Runtime APIs.
Choosing Between Them
Start with BundleDrop.init in every app.
Use useBundleDrop if you want to build your own update UI and let users trigger actions manually.
If you want startup automation, choose a non-manual policy in BundleDrop.init. The policy behavior is covered in Update Policies.
Typical Usage
index.js
1import { BundleDrop, useBundleDrop } 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});
9
10// Manual UI (hook)
11const {
12 status,
13 channelName,
14 setChannel,
15 isBusy,
16 installedInfo,
17 pendingApply,
18 checkLatest,
19 downloadUpdate,
20 applyUpdate,
21} = useBundleDrop();
22
23// downloadUpdate() stages the bundle.
24// It applies on next launch or when you call applyUpdate().Related Docs
- For lower-level runtime functions, see Runtime APIs.
- For runtime startup setup, see BundleDrop.init.
- For manual UI-driven flows, see useBundleDrop.
- For policy behavior, see Update Policies.