keplerscript-netmgr-lib.
Installation
Follow these steps to installkeplerscript-netmgr-lib.
-
Add the library dependency in your React Native for Vega application’s
package.json: -
Add
com.amazon.network.serviceto[wants.service]in your React Native for Vega app’smanifest.toml: -
Add API permission to
[wants.privilege]in your React Native for Vega app’smanifest.toml: -
Reinstall dependencies using the
npm installcommand.
API privileges
To access full API functionality, your app needs thecom.amazon.network.privilege.net-info privilege. The user must grant this privilege at runtime. Without it, API responses are limited.
To manage privileges:
- Check the current privilege status using
checkPrivilege("com.amazon.network.privilege.net-info"). - Request user consent by calling
requestPrivilege(), if needed.
Usage
The following code example shows how to query network status:Methods
fetch() and refresh() methods return NetInfoState to access the network connection information.

