react-native-netinfo
The react-native-netinfo API allows you to access network connection information. The Vega-ported version of this library has a different package name, keplerscript-netmgr-lib.
Installation
Follow the steps below to install keplerscript-netmgr-lib.
- Add the library dependency in your React Native for Vega application's package.json:"dependencies": { ... "@amazon-devices/keplerscript-netmgr-lib": "~2.0.0", ... }
- Add com.amazon.network.serviceto[wants.service]in your React Native for Vega app'smanifest.toml:[[wants.service]] id = "com.amazon.network.service"
- Add API permission to [wants.privilege]in your React Native for Vega app'smanifest.toml:[wants] [[wants.privilege]] id="com.amazon.network.privilege.net-info"
- Reinstall dependencies using npm installcommand.
API privileges
To access full API functionality, your app needs the com.amazon.network.privilege.net-info privilege. This privilege must be granted by the user at runtime. Without it, API responses will be limited. To manage privileges:
- Check the current privilege status using checkPrivilege("com.amazon.network.privilege.net-info").
- If needed, request user consent by calling requestPrivilege().
For complete details, see the Security Manager API documentation.
Usage
The following code snippet shows how to query network status:
import {NetInfoStateType, fetch} from "@amazon-devices/keplerscript-netmgr-lib";
fetch().then(state => {
      console.log("is connected? " + state.isConnected);
      if (state.type === NetInfoStateType.wifi) {
        console.log("ssid is " + state.details.ssid);
      }
});
Supported Methods
| API | Description | 
|---|---|
| fetch() | Returns cached network information. | 
| refresh() | Updates network state and returns network information. | 
| addEventListener() | Listens for network connection changes. | 
| useNetInfo() | Gets access to the latest state from the global instance. | 
fetch() and refresh() returns NetInfoState to access the network connection information.
| Property | Description | 
|---|---|
| type | NetInfoStateType.wifiif the connection is Wi-Fi. | 
| isConnected | trueif Wi-Fi is connected; otherwisefalse. | 
| isInternetReachable | trueif the internet is reachable; otherwisefalse. | 
| ssidindetails | The SSID of the connected access point. "<unknown ssid>"returned ifcom.amazon.network.privilege.net-infoprivilege is denied. | 
| bssidindetails | The BSSID of the connected access point. "02:00:00:00:00:00"returned ifcom.amazon.network.privilege.net-infoprivilege is denied. | 
| strengthindetails | The signal strength of the current Wi-Fi connection. | 
| ipAddressindetails | The IP address. | 
| subnetindetails | The subnet mask. | 
| frequencyindetails | The center frequency. | 
| linkspeedindetails | The link speed in bps of the current connection. | 
| isConnectionExpensiveindetails | trueif the connection is expensive; otherwisefalse. | 
Implementation details
Test on the simulator
You can test the network connection on the Vega Virtual Device by running the following commands.
kepler exec vda shell
ace mw wifi_cli add_network ssid=test psk=test_password
ace mw wifi_cli connect test
Supported versions
| package version | @amazon-devices/react-native-kepler version | 
|---|---|
| 2.0.x | 2.0.x+rn0.72.0 | 
Additional resources
For information on additonal libraries, see Supported Third-Party Libraries and Services.
Last updated: Oct 22, 2025

