# SDK Integration — Bundle Drop Docs

> Integrate the Bundle Drop SDK into your React Native app — configuration, update manager, and runtime hooks.

Canonical: https://bundledrop.app/docs/sdk-integration

Initialize Bundle Drop once, then choose the level of control your app needs:

- [BundleDrop.init](/docs/init-update-manager) for startup configuration and policy-driven behavior
- [useBundleDrop](/docs/use-bundle-drop) for manual, UI-driven update workflows
- [Runtime APIs](/docs/runtime-apis) for lower-level direct control

## Runtime APIs

- `checkForUpdate(...)`: checks whether an update, rollback, or no-op decision is available
- `downloadUpdate(...)`: downloads and stages an update
- `applyUpdate(...)`: applies a staged update and reloads the app
- `getUpdateState()`: returns whether a bundle exists locally and whether one is pending apply
- `getAvailableChannels()`: fetches public channel names
- `BundleDrop.setChannel(...)`: switches the active runtime channel
- `setUserProperty(...)` and `removeUserProperty(...)`: manage user properties for targeted rollout
- `getObservabilityContext()`: returns the running bundle's `dist` (hash), channel, and tags for error tracking — see [Observability](/docs/observability)

The detailed function behavior and return shapes are covered on [Runtime APIs](/docs/runtime-apis).

## Choosing Between Them

Start with [BundleDrop.init](/docs/init-update-manager) in every app.

Use [useBundleDrop](/docs/use-bundle-drop) 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](/docs/init-update-manager). The policy behavior is covered in [Update Policies](/docs/update-policies).

## Typical Usage

**index.js**

```ts
import { BundleDrop } from "@gfean/react-native-bundle-drop";

BundleDrop.init({
  enabled: !__DEV__,
  environment: __DEV__ ? "development" : "production",
  channelName: "develop",
  policy: __DEV__ ? "manual" : "on-next-launch",
});
```

Call the hook inside a React component, after initialization. For example, expose an explicit apply action when an update or rollback is staged:

**UpdatesScreen.tsx**

```tsx
import { Alert, Button, Text, View } from "react-native";
import { useBundleDrop } from "@gfean/react-native-bundle-drop";

export function UpdatesScreen() {
  const { status, isBusy, pendingApply, applyUpdate } = useBundleDrop();

  async function applyPendingUpdate() {
    try {
      await applyUpdate();
    } catch (error) {
      Alert.alert("Update unavailable", String(error));
    }
  }

  return (
    <View>
      <Text>{status}</Text>

    </View>
  );
}
```

Automatic application follows the configured policy. For a complete custom UI with download and channel controls, see [useBundleDrop](/docs/use-bundle-drop#typical-usage).

## Related Docs

- For automatic compatibility with optional explicit runtime boundaries, see [Native Fingerprinting](/docs/native-fingerprinting).
- For lower-level runtime functions, see [Runtime APIs](/docs/runtime-apis).
- For runtime startup setup, see [BundleDrop.init](/docs/init-update-manager).
- For manual UI-driven flows, see [useBundleDrop](/docs/use-bundle-drop).
- For policy behavior, see [Update Policies](/docs/update-policies).
- For error tracking and source maps, see [Observability](/docs/observability).
