All Products
Search
Document Center

SuperApp:Specifications and limits

Last Updated:Jun 02, 2026

Learn about the User-Agent (UA) format and JavaScript API call specifications for WindVane miniapps.

UA specifications

WindVane appends a WindVane tag, its SDK version, client-specific User-Agent (UA), and screen resolution to the default UA string for environment detection.

A complete UA contains the following space-separated elements: default UA (app name or version), WindVane or WindVane SDK version, additional client UA, and resolution (WxH).

Sample Android UA:

Mozilla/5.0 (Linux; Android 10; TAS-AN00 Build/HUAWEITAS-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.93 Mobile Safari/537.36 TTID/aaa WindVane/8.5.0

Sample iOS UA:

Mozilla\/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/19F70 AliApp(EMASDemo\/2.0.0) WindVane\/8.6.1 TBIOS 1170x2532
  • On iOS, use the setAppUA method to configure the additional client UA. Use lowercase x in the resolution field.

  • On Android, no method is provided to configure the additional client UA. Use uppercase X in the resolution field.

Important

Do not use the additional client UA to determine the OS and version of the client.

JavaScript API specifications

Call client features with window.WindVane.call(className, methodName, params, successCallback, failureCallback, timeout).

Note

JavaScript APIs do not work inside iframes.

Input parameters

Type

Parameter

Description

string

className

Client class to call.

string

methodName

Client method to call.

object

params

Parameters to pass to the client.

function

successCallback

Callback on successful JSBridge call.

function

failureCallback

Callback on failed JSBridge call.

number

timeout

Optional. JSBridge call timeout. On timeout, the callback receives {ret:['HY_TIMEOUT']}.

Both successCallback and failureCallback are invoked by native code. Place try...catch blocks inside the callback function to catch exceptions.

This topic uses the className.methodName format to specify client class and method names.

Callback parameter: A successful client API call triggers the success callback; a failed call triggers the failure callback. Callback parameters vary by API.

ret in the callback parameter: Callback parameters may include a ret property that indicates the call status. Valid values:

Value

Description

'HY_SUCCESS'

API call succeeded. Returned only in success callbacks.

'HY_CLOSED'

JSBridge is forcibly disabled. Typically caused by the page URL not being in the trusted domain list, or JSBridge not being enabled for the native app. Verify the URL or contact the HTML5 container-native developers.

'HY_NO_HANDLER'

The client does not support this API. Verify the JSBridge call and contact the native app provider.

'HY_PARAM_ERR'

Invalid input parameter.

'HY_NO_PERMISSION'

The page lacks permission to call this API.

'HY_FAILED'

API call failed. Contact the native app provider to troubleshoot.

'HY_EXCEPTION'

An error occurred during the API call. Contact the native app provider to troubleshoot.

'HY_USER_DENIED'

The API lacks the required permissions. For example, the client tried to access the album but was denied.

'HY_USER_CANCELLED'

The user canceled the API request.

'HY_RET_PHOTO_CANCLE'

The user canceled the photo capture request from the WVCamera API.

'HY_TIMEOUT'

JSBridge call timed out.

'HY_RESULT_PARSE_ERROR'

Invalid data format passed from the native app to HTML5.

'HY_NOT_IN_WINDVANE'

The current environment is not WindVane (for example, a browser), the client-provided WindVane UserAgent is invalid, or page JavaScript incorrectly modified an environment variable in windvane.js (for example, setting WindVane.isAvailable to false).

'HY_NOT_SUPPORT_DEVICE'

JSBridge was called on an unsupported device or environment (for example, a browser), or page JavaScript incorrectly modified an environment variable in windvane.js (for example, setting WindVane.isAvailable to false).

'HY_NO_HANDLER_ON_WP'

JSBridge was called on a Windows device or an unsupported environment (for example, a browser).

'WV_ERR::PARAM_PARSE_ERROR'

Invalid data format passed from the native app to HTML5.

The ret value varies by API and can be an empty string, a string, or an array. ret[0] contains the client API execution state. Not all APIs invoke callbacks — callback behavior depends on the client implementation. Each API's documentation specifies when success or failure callbacks occur.