What is the native bridge?
Some capabilities don’t live in JavaScript at all: reading files, fetching device and build info, reloading the bundle. They live in native modules, compiled into the app and exposed to JS through React Native’s bridge.native is how you reach them. It resolves native modules by name and ships a handful of pre-resolved handles for the ones Unbound needs most.
Resolving native modules
A native module’s name varies across platforms and Discord versions. The iOS file manager might beDCDFileManager on one build and RTNFileManager on another. So getNativeModule takes a list of candidate names and returns the first one that resolves, checking both NativeModules and the TurboModule registry.
Built-in handles
The native modules Unbound depends on are already resolved for you:BundleInfo
BundleInfo
Build and release metadata: version, release channel, build number, identifier.
BundleManager
BundleManager
The bundle updater. Drives OTA update checks and reloads (see below).
DeviceInfo
DeviceInfo
Hardware and OS details: device model, manufacturer, system version, RAM.
File manager
File manager
The native file module the fs module is built on. Prefer
fs for file work, since it resolves paths and defaults encodings for you.Reloading & UnboundNative
reload() is the safe way to restart the bundle: it persists pending settings first, then reloads, so nothing in flight is lost.
UnboundNative is the raw JSI bridge the platform loader installs on the global. The higher-level handles above are built on top of it, and you generally won’t touch it directly.
If
UnboundNative is missing, the environment isn’t a real Unbound install and most native features won’t work. That’s a bug worth reporting, not a state to handle in your addon.