@capgo/capacitor-wifi

June 16, 2026 ยท View on GitHub

Capgo - Instant updates for Capacitor

โžก๏ธ Get Instant updates for your App with Capgo

Missing a feature? We'll build the plugin for you ๐Ÿ’ช

Manage WiFi connectivity for your Capacitor app

Why Capacitor WiFi?

A free and powerful WiFi management plugin with modern platform support:

  • Network management - Connect, disconnect, and add WiFi networks programmatically
  • Network scanning - Discover available WiFi networks (Android only)
  • Network info - Get SSID, IP address, and signal strength (RSSI)
  • Modern APIs - Uses NetworkExtension (iOS) and handles Android 10+ restrictions
  • Cross-platform - Consistent API across iOS and Android

Perfect for IoT apps, network diagnostic tools, and smart home applications.

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/wifi/

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*โœ…
v7.*.*v7.*.*On demand
v6.*.*v6.*.*โŒ
v5.*.*v5.*.*โŒ

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-wifi` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capgo/capacitor-wifi
npx cap sync

Requirements

  • iOS: Requires location permission (NSLocationWhenInUseUsageDescription in Info.plist) to access WiFi information. Uses NetworkExtension framework.
  • Android: Requires location permissions. Network scanning and RSSI available on Android only. Android 10+ uses system dialogs for adding networks.

API

WiFi plugin for managing device WiFi connectivity

addNetwork(...)

addNetwork(options: AddNetworkOptions) => Promise<void>

Show a system dialog to add a Wi-Fi network to the device. On Android SDK 30+, this opens the system Wi-Fi settings with the network pre-filled. On iOS, this connects to the network directly.

ParamTypeDescription
optionsAddNetworkOptions- Network configuration options

Since: 7.0.0


connect(...)

connect(options: ConnectOptions) => Promise<void>

Connect to a Wi-Fi network. On Android, this creates a temporary connection that doesn't route traffic through the network by default. Set autoRouteTraffic to true to bind app traffic to the connected network (useful for local/device-hosted APs). For a persistent connection on Android, use addNetwork() instead. On iOS, this creates a persistent connection.

ParamTypeDescription
optionsConnectOptions- Connection options

Since: 7.0.0


disconnect(...)

disconnect(options?: DisconnectOptions | undefined) => Promise<void>

Disconnect from the current Wi-Fi network. On iOS, only disconnects from networks that were added via this plugin.

ParamTypeDescription
optionsDisconnectOptions- Optional disconnect options

Since: 7.0.0


getAvailableNetworks()

getAvailableNetworks() => Promise<GetAvailableNetworksResult>

Get a list of available Wi-Fi networks from the last scan. Only available on Android.

Returns: Promise<GetAvailableNetworksResult>

Since: 7.0.0


getIpAddress()

getIpAddress() => Promise<GetIpAddressResult>

Get the device's current IP address. Available on both Android and iOS.

Returns: Promise<GetIpAddressResult>

Since: 7.0.0


getRssi()

getRssi() => Promise<GetRssiResult>

Get the received signal strength indicator (RSSI) of the current network in dBm. Only available on Android.

Returns: Promise<GetRssiResult>

Since: 7.0.0


getSsid()

getSsid() => Promise<GetSsidResult>

Get the service set identifier (SSID) of the current network. Available on both Android and iOS.

Returns: Promise<GetSsidResult>

Since: 7.0.0


getWifiInfo()

getWifiInfo() => Promise<WifiInfo>

Get comprehensive information about the currently connected WiFi network. This method provides detailed network information including SSID, BSSID, IP address, frequency, link speed, and signal strength in a single call. On iOS, some fields may not be available and will be undefined.

Returns: Promise<WifiInfo>

Since: 7.0.0


isEnabled()

isEnabled() => Promise<IsEnabledResult>

Check if Wi-Fi is enabled on the device. Only available on Android.

Returns: Promise<IsEnabledResult>

Since: 7.0.0


startScan()

startScan() => Promise<void>

Start scanning for Wi-Fi networks. Only available on Android. Results are delivered via the 'networksScanned' event listener. Note: May fail due to system throttling or hardware issues.

Since: 7.0.0


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check the current permission status for location access. Location permission is required for Wi-Fi operations on both platforms.

Returns: Promise<PermissionStatus>

Since: 7.0.0


requestPermissions(...)

requestPermissions(options?: RequestPermissionsOptions | undefined) => Promise<PermissionStatus>

Request location permissions from the user. Location permission is required for Wi-Fi operations on both platforms.

ParamTypeDescription
optionsRequestPermissionsOptions- Optional permission request options

Returns: Promise<PermissionStatus>

Since: 7.0.0


addListener('networksScanned', ...)

addListener(eventName: 'networksScanned', listenerFunc: () => void) => Promise<PluginListenerHandle>

Add a listener for the 'networksScanned' event. Only available on Android. This event is fired when Wi-Fi scan results are available.

ParamTypeDescription
eventName'networksScanned'- The event name ('networksScanned')
listenerFunc() => void- The callback function to execute

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 7.0.0


isNetworkSaved(...)

isNetworkSaved(options: IsNetworkSavedOptions) => Promise<IsNetworkSavedResult>

Check whether a network with the given SSID has already been saved/configured by this app. On Android SDK 30+, this checks the app's Wi-Fi network suggestions. On older Android (including SDK 29), this checks the system's configured networks list. On iOS, this checks the hotspot configurations managed by this app. Use this to decide whether to call addNetwork() (first time) or connect() (already saved).

ParamTypeDescription
optionsIsNetworkSavedOptions- Options containing the SSID to check

Returns: Promise<IsNetworkSavedResult>

Since: 8.2.0


getPluginVersion()

getPluginVersion() => Promise<{ version: string; }>

Get the native plugin version.

Returns: Promise<{ version: string; }>

Since: 7.0.0


Interfaces

AddNetworkOptions

Options for adding a network

PropTypeDescriptionDefaultSince
ssidstringThe SSID of the network to add7.0.0
passwordstringThe password for the network (optional for open networks)7.0.0
isHiddenSsidbooleanWhether the network is hidden (Android only)false7.0.0
securityTypeNetworkSecurityTypeThe security type of the network (Android only)NetworkSecurityType.WPA2_PSK7.0.0

ConnectOptions

Options for connecting to a network

PropTypeDescriptionDefaultSince
ssidstringThe SSID of the network to connect to7.0.0
passwordstringThe password for the network (optional for open networks)7.0.0
isHiddenSsidbooleanWhether the network is hidden (Android only)false7.0.0
autoRouteTrafficbooleanWhether to automatically route app traffic through the connected Wi-Fi network (Android only) When enabled, it binds the app process to the connected network using ConnectivityManager.bindProcessToNetwork() This is useful for connecting to local/device-hosted APs (e.g., ESP32, IoT devices) that don't have internet access.false7.0.0

DisconnectOptions

Options for disconnecting from a network

PropTypeDescriptionSince
ssidstringThe SSID of the network to disconnect from (optional)7.0.0

GetAvailableNetworksResult

Result from getAvailableNetworks()

PropTypeDescriptionSince
networksNetwork[]List of available networks7.0.0

Network

Represents a Wi-Fi network

PropTypeDescriptionSince
ssidstringThe SSID of the network7.0.0
rssinumberThe signal strength in dBm7.0.0
securityTypesNetworkSecurityType[]The security types supported by this network (Android SDK 33+ only)7.0.0

GetIpAddressResult

Result from getIpAddress()

PropTypeDescriptionSince
ipAddressstringThe device's IP address7.0.0

GetRssiResult

Result from getRssi()

PropTypeDescriptionSince
rssinumberThe signal strength in dBm7.0.0

GetSsidResult

Result from getSsid()

PropTypeDescriptionSince
ssidstringThe SSID of the current network7.0.0

WifiInfo

Comprehensive WiFi information

PropTypeDescriptionSince
ssidstringThe SSID (network name) of the current network7.0.0
bssidstringThe BSSID (MAC address) of the access point. Not available on iOS.7.0.0
ipstringThe device's IP address on the network7.0.0
frequencynumberThe network frequency in MHz. Not available on iOS.7.0.0
linkSpeednumberThe connection speed in Mbps. Not available on iOS.7.0.0
signalStrengthnumberThe signal strength (0-100). Calculated from RSSI on Android. Not available on iOS.7.0.0

IsEnabledResult

Result from isEnabled()

PropTypeDescriptionSince
enabledbooleanWhether Wi-Fi is enabled7.0.0

PermissionStatus

Permission status

PropTypeDescriptionSince
locationPermissionStateLocation permission state7.0.0

RequestPermissionsOptions

Options for requesting permissions

PropTypeDescriptionSince
permissions'location'[]Permissions to request7.0.0

PluginListenerHandle

PropType
remove() => Promise<void>

IsNetworkSavedResult

Result from isNetworkSaved()

PropTypeDescriptionSince
isSavedbooleanWhether the network has already been saved/configured by this app8.2.0

IsNetworkSavedOptions

Options for checking whether a network is saved

PropTypeDescriptionSince
ssidstringThe SSID of the network to check8.2.0

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Enums

NetworkSecurityType

MembersValueDescriptionSince
OPEN0Open network with no security7.0.0
WEP1WEP security7.0.0
WPA2_PSK2WPA/WPA2 Personal (PSK)7.0.0
EAP3WPA/WPA2/WPA3 Enterprise (EAP)7.0.0
SAE4WPA3 Personal (SAE)7.0.0
WPA3_ENTERPRISE5WPA3 Enterprise7.0.0
WPA3_ENTERPRISE_192_BIT6WPA3 Enterprise 192-bit mode7.0.0
PASSPOINT7Passpoint network7.0.0
OWE8Enhanced Open (OWE)7.0.0
WAPI_PSK9WAPI PSK7.0.0
WAPI_CERT10WAPI Certificate7.0.0