Migration to v2
Voltra v2 introduces two major architectural changes:
- The old Voltra umbrella package is gone. Voltra now ships as separate iOS, Android, and server packages.
- The native layer moved from Expo Modules to Turbo Modules.
Upgrading to v2 requires updating package installs, Expo plugin configuration, and some API usage. This guide walks through those changes.
Recommended migration order
- Replace package installs.
- Swap the Expo plugin to the platform-specific package.
- Move JSX imports to
@use-voltra/iosor@use-voltra/android. - Move runtime APIs to the matching
*-clientpackage. - Move server rendering code to
@use-voltra/ios-serveror@use-voltra/android-server. - Rename Android widget APIs that became platform-specific.
- Verify
initialStatePathfiles only import from platform packages.
What changed
- Package split: old
voltra,voltra/client,voltra/server,voltra/android, etc. paths are replaced by scoped packages (@use-voltra/ios,@use-voltra/ios-client,@use-voltra/ios-server,@use-voltra/android,@use-voltra/android-client,@use-voltra/android-server,@use-voltra/server). - Platform-specific JSX namespaces: iOS primitives come from
@use-voltra/iosasVoltra; Android primitives, color tokens, and ongoing notification JSX come from@use-voltra/androidasVoltraAndroid,AndroidDynamicColors, andAndroidOngoingNotification. - Client APIs stay in
*-client: runtime APIs that run inside the React Native app (starting/updating Live Activities, updating or pinning widgets, preview components, event listeners and hooks) come from@use-voltra/ios-clientand@use-voltra/android-client. - Server APIs are platform-specific: use
@use-voltra/ios-serverand@use-voltra/android-serverfor server-side rendering, and@use-voltra/serveronly for cross-platform widget HTTP handlers.
See the sections below for exact import diffs.
Installation changes
Install the packages that match the layers you use.
iOS app code
Android app code
Optional server packages
Import mapping
iOS app code
iOS server code
Android widget code
Android server widget code
Expo plugin migration
The old docs used a single voltra plugin and nested per-platform config. v2 uses platform-specific plugins.
iOS
Android
API renames to watch for
- Android widget updates:
updateWidget(...)->updateAndroidWidget(...) - Android widget reloads:
reloadWidgets(...)for image-preloading remains, but widget refresh APIs usereloadAndroidWidgets(...) - Android widget server handlers:
createWidgetUpdateHandler(...)style examples should becomecreateAndroidWidgetUpdateHandler(...),createAndroidWidgetUpdateNodeHandler(...), orcreateAndroidWidgetUpdateExpressHandler(...) - iOS widget server handlers: use
createIOSWidgetUpdateHandler(...),createIOSWidgetUpdateNodeHandler(...), orcreateIOSWidgetUpdateExpressHandler(...)
Pre-render files
initialStatePath files run in Node during prebuild, not in the React Native runtime.
Use:
@use-voltra/iosfor iOS widget JSX and types@use-voltra/androidfor Android widget JSX and types
Do not import @use-voltra/ios-client or @use-voltra/android-client from pre-render files.
After migrating
Re-run prebuild for any platform whose plugin configuration changed:
