Porting third-party libraries to Vega

By making your libraries and services Vega-compatible, you can ensure they integrate seamlessly with the platform and become available to a growing community of Vega app developers. This allows you to expand the reach and adoption of your libraries and services across Amazon devices. This article provides an overview of what you should consider when porting your library to Vega.

Supported libraries and services
To learn more about the libraries supported on Vega today, take a look at Vega supported libraries and services.

Determine library compatibility

React Native for Vega leverages Hermes which is a JavaScript engine that pre-compiles JavaScript code (including libraries) into bytecode during the build process. Most pure JavaScript/TypeScript libraries without underlying platform-specific dependencies will work directly with Hermes, however some features may not be supported and you should test your library for compatibility. React Native for Vega is not a browser-based environment, if your library uses Document Object Model (DOM) / Web APIs (e.g Document), you will need to remove or polyfill them for Vega. If your library relies on core React Native components and APIs (e.g. Platform), you will need to ensure they are supported in React Native for Vega.

W3C Media API
We have implemented W3C Media API in a React Native component for app and library developers. If your library is a media player or captures video analytics, take a look at W3C Media API in React Native for Vega.

Vega is not compatible with native iOS and Android libraries, you will need to re-write any platform-specific implementation for Vega, see Platform-specific dependencies section for more details. Vega does support standard C/C++ libraries, and other OSS libraries as long as their only dependencies are standard C/C++ libraries - though you will need to create a Turbo Module to build out React Native bindings for React Native for Vega apps.

Let’s take a look at a few examples:

  • Lodash - This is a pure JavaScript utility library without any platform-specific dependencies. This library works out-of-the-box on React Native for Vega.
  • react-native-uuid - This is a pure TypeScript implementation for UUIDs without any platform-specific dependencies. This library works out-of-the-box on React Native for Vega.
  • react-native-device-info - This is a React Native library that provides device information for React Native apps. This library has native code implementation for each platform (e.g. iOS, Android). For React Native for Vega apps, this library was ported by Amazon with a native implementation for Vega using the Vega-equivalent API to retrieve device information (e.g. device model, version and manufacturer).
  • launchdarkly/react-native-client-sdk - This is a pure TypeScript React Native library that provides feature Launch Darkly’s feature flag management for React Native apps. This library works-out-of-the-box on React Native for Vega with a dependency on react-native-async-storage.
  • sentry/react-native - This is a React Native library that provides Sentry’s crash reporting and error monitoring for React Native apps. This library acts as a wrapper/bridge between React Native and Sentry’s native iOS and Android SDKs. This library did not work out-of-the-box for React Native for Vega apps, and had to ported with a Vega-specific implementation with the help of sentry-native.
  • react-native-fast-image - This is a React Native library for image loading and caching in React Native apps. This library is a wrapper around the native SDWebImage (iOS) and Glide (Android) libraries. This library did not work out-of-the-box for React Native for Vega apps, and had to ported by Amazon with a native implementation for Vega using the Vega-equivalent API.

Once you are set up with Vega SDK, you can integrate your library into one of our Sample Apps to test it on Vega.

Platform-specific dependencies

If your library relies on platform-specific APIs, you will need to review Vega APIs to find the Vega-equivalent API. For example, if you leverage Android’s AdvertisingIdClient.getAdvertisingIdInfo() to fetch an advertising ID then on Vega you will need to use AdIdRetriever.fetchAdvertisingId().

In addition, we have ported a number of popular React Native community libraries that abstract common use cases (e.g. device metadata, storage) and will help speed up your development.

Getting support
You can submit your questions in the Q&A section. To request any missing capabilities, please use the Feature Requests section.

Testing your library

It is important to test your library thoroughly and with the latest Vega SDK releases to ensure it remains compatible with Vega. You can integrate your library with one of our Sample Apps for testing. It is important to consider the differences between the simulator and hardware when testing your library.

To debug any issues in your library, you can use line-by-line debugging and analyze crash reports using Vega Studio. You can also inspect network traffic in Vega apps using Charles Proxy. Visit our app performance center to learn about our tooling and best practices.

Here are some of the areas to cover in your testing:

  • Core functionality - Verify API functionality, performance (e.g. CPU and memory usage, UI fluidity), error handling and device compatibility (simulator and hardware).
  • Vega SDK compatibility - Compatibility with the latest version of Vega SDK. Ensure backward compatibility for app developers running on older versions of Vega SDK.
  • React Native version compatibility - Compatibility with React Native 0.72. See React Native for Vega reference for supported APIs.
  • Setup and installation - Verify the package installation and setup instructions for your library. If you leverage Turbo Modules, you want to ensure build configuration and autolinking is working as expected.
  • Third-parity library conflicts - If your library has a dependency on any of the libraries listed under React Native for Vega ported libraries, use Vega Module Resolver Preset to avoid compatibility issues.

Reporting issues
You can submit your questions in the Q&A section. For suspected bugs, please use the Bug Reports section.

Distributing your library

You can use your existing public-facing distribution mechanisms (e.g. npm, third-party developer portal). For example, to publish your package to the npm registry, see npm’s creating and publishing packages page for guidance.

Informing app developers
Reach out to your Amazon representative to get your library added to the Vega supported libraries and services and Supported Libraries and Services pages. You can also post a Knowledge Base article to showcase your library and how to get started.

FAQ

  1. How do you create a library for React Native?
    See React Native’s Create a Library page for guidance on building libraries for React Native apps. You can create a kepler folder for your Vega-specific code.
  2. Which version of React Native does Vega support?
    React Native for Vega supports React Native 0.72, with support for 0.76 coming in late 2025.
  3. Does Vega support React Native’s New Architecture?
    Vega supports New Architecture - which includes Fabric and Turbo Modules.
  4. How can you lookup device metadata?
    Vega provides Platform API and a port of react-native-device-info for developers to lookup device metadata.
  5. How can you request a new features/API for Vega?
    To request any missing capabilities, please use the Feature Requests section. You can also submit questions in the Q&A section to get guidance from Amazon engineers.
  6. How can you report suspected bugs for Vega?
    For suspected bugs, please use the Bug Reports section.
  7. Does Vega support JavaScript/TypeScript libraries?
    React Native for Vega supports pure JavaScript/TypeScript libraries, as long as they do not have DOM dependencies. If your library uses DOM / Web API dependencies you may need to remove or polyfill them for Vega.
  8. Does Vega support native Android/iOS libraries?
    Libraries that rely on platform-specific implementations (i.e. leveraging iOS and Android APIs) will not work out-of-the-box on Vega. You will need to develop a new library for Vega that leverages the APIs supported on Vega.
  9. Does Vega support native C/C++ libraries?
    Vega supports standard C/C++ libraries, and other OSS libraries as long as their only dependencies are standard C/C++ libraries. You can create a Turbo Module to build out React Native bindings for React Native for Vega apps.
  10. Does Vega support WebCrypto API?
    We have a partial implementation of the WebCrypto API available through the Vega Crypto library.
  11. Does Vega provide a way to capture app lifecycle events?
    React Native’s AppState API can notify you when the state of an app changes.
  12. Does Vega provide a way to capture video analytics?
    We have implemented W3C Media API in a React Native component for app developers, you can use this API as hooks for media playback events.
  13. How can you inform developers that your library is compatible with Vega?
    Reach out to your Amazon representative to get your library added to the Vega supported libraries and services and Supported Third-Party Libraries and Services pages. You can also post a Knowledge Base article to showcase your library and how to get started.
  14. How can you ensure your library remains compatible with Vega?
    We regularly release new Vega SDK versions with new features, fixes, and improvements. We recommend testing your library against each release to ensure it remains compatible with Vega.