Copyright © 2021 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
This specification is a registry of supplementary members for the Web Application Manifest and the Web App Manifest - Application Information specifications that provide additional metadata to an application manifest to describe MiniApps. This JSON-based manifest file enables developers to set up basic information, window style, page route, and other information of a MiniApp. The manifest also includes information about the window style like the navigation bar, title, window background color, page routing information, and the widgets that are part of a MiniApp.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document was published by the MiniApps Working Group as a First Public Working Draft. This document is intended to become a W3C Recommendation.
GitHub Issues are preferred for discussion of this specification.
Publication as a First Public Working Draft does not imply endorsement by the W3C Membership.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 15 September 2020 W3C Process Document.
A MiniApp manifest is a [JSON] document that extends and profiles the Web App Manifest [APPMANIFEST] and the Web App Manifest - Application Information [MANIFEST-APP-INFO], to describe metadata associated with a MiniApp.
A MiniApp manifest MUST contain the following members at its root:
Each image resource object within the MiniApp manifest's
member MUST contain:
icons
A MiniApp manifest MAY contain a
member at its root. This member MUST contain an array of MiniApp widget resources. Each MiniApp widget resource object MUST contain the following members:
widgets
A MiniApp manifest MAY contain a
member at its root. This member MUST contain an array of MiniApp permission resources. Each MiniApp permission resource object MUST contain the following member:
req_permissions
The presence of other members in a MiniApp manifest is optional, but vendor-specific extensions MAY modify this.
As the application manifest is JSON, this specification relies on the [JSON] specification. This specification includes members typed as number, boolean literals, object, array, and string.
The following table shows a summary of the MiniApp manifest's members:
Member | Type | Required | Description |
---|---|---|---|
|
string | Yes | Identifier |
|
string | No | Description |
|
string | No | Direction of texts |
|
image resource array | Yes | MiniApp icons |
|
string | No | Primary language |
|
string | Yes | Minimum platform version supported |
|
string | Yes | App name |
|
array | Yes | Page routing information |
|
permission resource array | No | Required permissions |
|
string | No | MiniApp short name |
|
string | Yes | Version code |
|
string | Yes | Version name |
|
widget resource array | No | Widgets |
|
window resource | No | Window style |
Member | Type | Required | Description |
---|---|---|---|
label |
string | No | Accessible text |
sizes |
string | No | Resolution sizes of the icon |
src |
string | Yes | Source of the icon |
Member | Type | Required | Description |
---|---|---|---|
|
string | Yes | Permission name |
|
string | No | Reason to request the permission |
Member | Type | Required | Description |
---|---|---|---|
|
string | Yes | Widget name |
path |
string | Yes | Widget path |
|
string | No | Minimum platform version supported |
Member | Type | Required | Description |
---|---|---|---|
|
boolean | No |
Enables/disables auto-calculation of page's
|
|
string | No | Window background color |
|
string | No | Background text style |
|
number | No | The baseline page design width |
|
boolean | No | Enable pull-to-refresh event |
|
boolean | No | Full screen display |
|
string | No | Navigation bar background color |
|
string | No | Text style of the navigation bar |
|
string | No | Navigation bar title |
|
string | No | Navigation bar style |
|
number | No | Distance for pull-up bottom event triggering |
|
string | No | Screen orientation settings |
Other application manifest members such as scope
,
theme_color
,
related_applications
,
prefer_related_applications
, and
shortcuts
are not currently supported by MiniApp user agents.
This section is non-normative.
The following code represents a MiniApp manifest example:
{
"dir": "ltr",
"lang": "en-US",
"app_id": "org.example.miniapp",
"name": "MiniApp Demo",
"short_name": "MiniApp",
"version_name": "1.0.1",
"version_code": 11,
"description": "A Simple MiniApp Demo",
"icons": [
{
"src": "common/icons/icon.png",
"sizes": "48x48"
}
],
"min_platform_version": "1.0.0",
"pages": [
"pages/index/index",
"pages/detail/detail"
],
"window": {
"navigation_bar_text_style": "black",
"navigation_bar_title_text": "My MiniApp",
"navigation_bar_background_color": "#f8f8f8",
"background_color": "#ffffff",
"fullscreen": false
},
"widgets": [
{
"name": "widget",
"path": "widgets/index/index",
"min_platform_version": "2.0.0"
}
],
"req_permissions": [
{
"name": "system.permission.LOCATION",
"reason": "To show user's position on the map"
},
{
"name": "system.permission.CAMERA",
"reason": "To scan a QR code"
}
]
}
The MiniApp manifest uses the following essential application manifest's members.
dir
member
The MiniApp manifest's dir
member, while specifying the base direction of the localizable members of the manifest, also specifies
the default base text direction of the whole MiniApp.
The
member's value can be set to one of the text-direction values as specified in [APPMANIFEST]. The text-direction values are the following:dir
"ltr"
"rtl"
"auto"
(default)
When processing a MiniApp manifest, the process the dir
member algorithm is used to process the dir
member, according to the [APPMANIFEST] specification.
icons
member
The MiniApp manifest's icons
member describes images that serve as iconic representations of MiniApps. This member is an array of image resource objects.
As specified in [IMAGE-RESOURCE], an image resource consists of:
label
sizes
link
's sizes
attribute.
src
When processing a MiniApp manifest, the process image resources algorithm is used to process the icons
member, according to the [APPMANIFEST] specification.
lang
member
The MiniApp manifest's lang
member, while specifying the primary language of the localizable members, also specifies
the primary language of the whole MiniApp. This member is a string in the form of a language tag, a string that matches the production of a Language-Tag
[BCP47], as defined in [APPMANIFEST].
When processing a MiniApp manifest, the process the lang
member algorithm is used to process the lang
member, according to the [APPMANIFEST] specification.
name
member
The MiniApp manifest's name
member is the descriptive name of the application. This is the name directly displayed to the user. It is used as the display name of MiniApp along with the desktop icon and in the context of MiniApp management.
When processing a MiniApp manifest, the process a text member algorithm is used to process the name
member, according to the [APPMANIFEST] specification.
short_name
member
The MiniApp manifest's short_name
member provides a concise and easy-to-read name for a MiniApp. It can be used when there is insufficient space to display the full MiniApp name provided in
.
name
When processing a MiniApp manifest, the process a text member algorithm is used to process the short_name
member, according to the [APPMANIFEST] specification.
The following member is defined in the Web App Manifest - Application Information specification [MANIFEST-APP-INFO].
description
member
The MiniApp manifest's description
member provides a textual description for the MiniApp representing the purpose of the web application in natural language, as defined in [MANIFEST-APP-INFO]
To process the description
member, given object json and ordered map manifest:
The following members are defined under the scope of the MiniApp manifest, addressing specific aspects of MiniApp.
app_id
member
The MiniApp manifest's app_id
member is a string that identifies the MiniApp univocally. This member is mainly used for package management, and it supports the update and release process of MiniApp versioning.
The format of
is RECOMMENDED to be a string defined by the following rule:
app_id
appIdRule = name *("." name)
name = ALPHA [*( ALPHA / DIGIT / "-" ) ( ALPHA / DIGIT)]
One common practice is to use the reverse-domain-name-like convention (e.g., org.example.miniapp
).
To process the app_id
member, given object json and ordered map manifest:
min_platform_version
member
The MiniApp manifest's min_platform_version
member is a string that indicates the minimum supported version of the MiniApp user agent's platform to ensure the regular operation of a MiniApp (e.g., "1.0.0"
).
The RECOMMENDED format for this member is "X.Y.Z"
, where X
, Y
, and Z
are non-negative integer values (e.g., "1.10.0"), as specified in Semantic Versioning [SEMANTIC-VERSIONING].
To process the min_platform_version
member, given object json and ordered map manifest:
pages
member
The MiniApp manifest's pages
member is an array of relative-url string used for specifying the collection of pages that are part of a MiniApp. Each item in the array represents a page route.
A MiniApp page route is the relative path and filename of a MiniApp Page.
During the MiniApp development process, adding or deleting MiniApp pages is done by configuring the array. When configuring the page routes, the file name extension MAY be omitted (e.g., /component/mypage).
The first item in the
array defines the homepage of a MiniApp.
pages
To process the pages
member, given object json and ordered map manifest:
req_permissions
member
The optional MiniApp manifest's req_permissions
member is an array of MiniApp permission resources objects.
Each MiniApp permission resource declares a request for using a concrete system feature (e.g., access to device's location, user contacts, sensors, and camera) required for the proper execution of the MiniApp.
To process the req_permissions
member, given object json and ordered map manifest:
name
member passing item and permission.reason
member passing item and permission.
User agents will ask for the user's consent to protect their privacy during access to these specific features. This information in the
member may be used by app stores or hosting platforms to filter MiniApps according to the user's preferences, privacy policy, or device capabilities.
req_permissions
version_code
member
The MiniApp manifest's version_code
member is a non-negative integer number that represents the version of a MiniApp. It is mainly used for enhancing the maintainability and security of MiniApp (e.g., compatibility among incremental versions). The
member aims at supporting the development and deployment process, and it is not usually displayed to the end-user.
version_code
Value by default: 1
.
The value of this member is usually incremented according to the version iteration process.
To process the version_code
member, given object json and ordered map manifest:
version_name
member
The MiniApp manifest's version_name
member is a string mainly used for describing information on the version of a MiniApp, playing an essential role in version control, MiniApp application, and platform compatibility. It is usually considered as the version that is shown publicly and displayed to the user.
The RECOMMENDED format for this member is X.Y.Z
, where X
, Y
, and Z
are non-negative integer values (e.g., 1.10.0), as specified in Semantic Versioning [SEMANTIC-VERSIONING].
To process the version_name
member, given object json and ordered map manifest:
widgets
member
The optional MiniApp manifest's widgets
member is an array of MiniApp widget resources that are a part of a MiniApp.
A MiniApp Package MAY include MiniApp pages and Widgets concurrently.
A widget, as part of a MiniApp, adopt some of the members of the MiniApp manifest, including:
dir
;lang
;app_id
;name
;short_name
;icons
;version_name
; andversion_code
However, a widget also has its exclusive fields as defined in the MiniApp widget resource.
To process the widgets
member, given object json and ordered map manifest:
name
member passing item and widget.path
member passing item and widget.min_platform_version
member passing item, manifest, and widget.window
member
The optional MiniApp manifest's window
member contains a MiniApp window resource object to describe the look and feel of the MiniApp frame, including the styles of the status bar, navigation bar, title, background colors, among other visual configuration elements.
The
object members inherit the text direction and language configuration from the window
and dir
members at the root of the MiniApp manifest.
lang
To process the window
member, given object json and ordered map manifest:
auto_design_width
member passing json["window"] and window.design_width
member passing json["window"] and window.enable_pull_down_refresh
member passing json["window"] and window.fullscreen
member passing json["window"] and window.navigation_bar_text_style
member passing json["window"] and window.navigation_bar_title_text
member passing json["window"] and window.on_reach_bottom_distance
member passing json["window"] and window.orientation
member passing json["window"] and window.auto_design_width
member passing json["window"] and window.The MiniApp manifest, as an extension of the Application manifest, provides a supplementary algorithm to be processed at the extension point of the processing a manifest algorithm defined in [APPMANIFEST].
To process a MiniApp manifest, given object json and ordered map manifest:
app_id
member passing json and manifest.description
member passing json and manifest.min_platform_version
member passing json and manifest.pages
member passing json and manifest.req_permissions
member passing json and manifest.version_code
member passing json and manifest.version_name
member passing json and manifest.widgets
member passing json and manifest.window
member passing json and manifest.A MiniApp permission resource is an object that describes a request for using a concrete system feature (e.g., access to device's location, user contacts, sensors, and camera) required for the proper execution of a MiniApp.
The following members are defined under the scope of the MiniApp manifest, addressing specific aspects of a permission resource.
name
member
The MiniApp permission resource's name
member is a string that indicates the name of the feature requested.
To process the permission resource's name
member, given object json and ordered map permission:
reason
member
The optional MiniApp permission resource's reason
member is a string that indicates the reason given to request the feature specified in the
attribute.
name
To process the permission resource's reason
member, given object json and ordered map permission:
A MiniApp widget resource is an object that defines and configures a widget that is part of a MiniApp.
The following members are defined under the scope of the MiniApp manifest, addressing specific aspects of a widget resource.
name
member
The MiniApp widget resource's name
member is a string that indicates the title of a widget.
To process the widget's name
member, given object json and ordered map widget:
path
member
The MiniApp widget resource's path member is a relative-url string that defines the corresponding page route of a widget, represented as in the
array.
pages
To process the widget's path
member, given object json and ordered map widget:
min_platform_version
member
The optional MiniApp widget resource's min_platform_version
member is a string that indicates the minimum platform version supported for a MiniApp widget.
Since Widget APIs and MiniApp APIs may differ, the declaration of the minimum version of the platform may be different. Thus, if the widgets member omits
explicitly, the user agent will consider the same requirement as the specified in the min_platform_version
member at the root of the manifest.
min_platform_version
To process the widget's min_platform_version
member, given object json, ordered map widget and ordered map manifest:
A MiniApp window resource is an object that defines and configures the window that contains a MiniApp.
The following members are defined under the scope of the MiniApp manifest, enabling the description of the MiniApp window resource.
auto_design_width
member
The auto_design_width
member is a boolean that indicates whether the
of the page is auto-calculated by the user agent. When design_width
is auto_design_width
true
, the value of
is ignored. In this case, the system's baseline width is automatically determined according to the pixel density of the screen.
design_width
Value by default: false
.
To process the window's auto_design_width
member, given object json and ordered map window:
background_color
member
The background_color
member is a string that specifies the background color of the window that contains a MiniApp.
This member supports sRGB colors, and it is equivalent to the application manifest's background_color
.
Value by default: "#ffffff"
.
When processing a MiniApp manifest, the process a color member algorithm is used to process the window's background_color
member, according to the [APPMANIFEST] specification.
background_text_style
member
The background_text_style
member is a string that specifies the background text style, indicating a light or dark color theme.
This member supports the values of prefers-color-scheme and MUST contain one of the following background text style values:
"light"
"dark"
(default)
To process the window's background_text_style
member, given object json and ordered map window:
design_width
member
The design_width
member is a number that indicates the baseline width of the page design in pixel unit. It is used for visually adjusting the page components.
The value is a non-negative integer and the value by default is 750
.
To process the window's design_width
member, given object json and ordered map window:
enable_pull_down_refresh
member
The enable_pull_down_refresh
member is a boolean that specifies if the pull-to-refresh
event is enabled during the interaction with the MiniApp.
Value by default: false
.
To process the window's enable_pull_down_refresh
member, given object json and ordered map window:
fullscreen
member
The fullscreen
member is a boolean that indicates if the MiniApp is shown in full-screen display mode.
When this member takes the true
value, it is equivalent to the fullscreen
value on the application manifest's display
member. When it takes false
as value, it is equivalent to minimal-ui
.
Value by default: false
.
To process the window's fullscreen
member, given object json and ordered map window:
on_reach_bottom_distance
member
The on_reach_bottom_distance
member is a number that defines the vertical offset from the bottom of the window required to trigger a page pull-up event. Values for this member are non-negative integers expressed in pixel unit.
Value by default: 50
.
To process the window's on_reach_bottom_distance
member, given object json and ordered map window:
orientation
member
The orientation
member is a string that specifies the configuration of the screen orientation for the MiniApp.
This member supports the orientation values: "portrait"
and "landscape"
defined in OrientationLockType
[SCREEN-ORIENTATION].
This member is equivalent to the application manifest's orientation
.
Value by default: "portrait"
.
To process the window's orientation
member, given object json and ordered map window:
The description of window.orientation
is currently:
Screen orientation settings, valid values:
portrait
andlandscape
.
It is not clear to me if this is just a default orientation when the user opens a MiniApp (the user can change it when using the MiniApp), or a locked orientation (the user can't change it).
A localizable member is a manifest member whose content may be adapted to specific linguistic, geographical, and cultural aspects. These localizable members share the language tag (
) and display direction (lang
) defined at manifest's root.
dir
The following members are localizable members:
As a crucial part of a MiniApp Package, the manifest.json
file describes several important aspects of the MiniApp by referring to the MiniApp Package resources in different file types, such as the page scripts and visual configuration files in the pages
directory and the images in the common
directory. Details are specified in [MINIAPP-PACKAGING].
The regular operation of a MiniApp relies on the proper configuration in the manifest and the MiniApp Package availability of resources. Such dependency needs to be checked during both the development phase and deployment phase.
As the manifest is a JSON document and will commonly be encoded using [UNICODE], the security considerations described in [[JSON] and [UNICODE-SECURITY] apply. In order to prevent developers from including custom/unrestrained data in a manifest, implementors may use a more strict schema than that defined in JSON Schema to impose their implementation-specific limits on the member names, types, and value ranges (e.g., to guard against memory overflow, or to meet platform-specific limitations).
Members like
, icons
, and pages
contain paths referring to local resources on the hosting platform. Implementors and the hosting platform should check the validity of those paths to prevent illegal access out of the scope of the MiniApp Package. On the other hand, the MiniApp itself (e.g., using scripting code) may provide mechanisms to access external resources either on the hosting platform or on remote websites (e.g., through a URI). In this case, the hosting platform is responsible for providing a clear indication to an end-user about such a context switch.
widgets
Additionally, the
member provides a specific means to control the access the local software, hardware, and data resources on the user's device. User's consent should be asked when it comes to privacy-related or high-level privileged resources.
req_permissions
The integrity of the manifest document is protected by a cryptographic hash mechanism as part of the whole MiniApp Package, as detailed in [MINIAPP-PACKAGING].
The user agent SHOULD provide the end-user with transparent metadata about a MiniApp (i.e.,
, app_id
, name
, short_name
icons
,
, version_name
), offering users enough information, allowing them to make a conscious decision about its usage. This practice could also help to identify spoofing MiniApps.
description
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, RECOMMENDED, and SHOULD in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This specification uses the Augmented Backus-Naur Form (ABNF) as defined in [RFC5234].
The MiniApp Manifest specification depends on the Infra Standard [INFRA] to describe algorithms.
Developers interested in validating the MiniApp manifest document can use the JSON Schema defined at https://w3c.github.io/miniapp-manifest/manifest_schema.json.
This section is non-normative.
This section is non-normative.
This specification is based on the application manifest extensibility principle.
Although proprietary extensions are undesirable, they may be included as a manifest extension. In this case, it is RECOMMENDED to use vendor prefixes for the new members.
We encourage implementors to add proprietary extensions to the Extensions Registry. This allows the community to track what extensions vendors and/or the web community have defined and documented.
The Web App Manifest allows adding new proprietary manifest members using vendor prefixes: https://www.w3.org/TR/appmanifest/#proprietary-extensions
We probably need something similar.
The following is an example of three hypothetical vendor extensions.
{
...
"wechat_new_feature": "foo",
"ali_new_url_system": "http://example.org",
"coolminiapp_menu_color": "#FA0000"
...
}
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in: