Plugin Functional Pages

View Markdown

Last edited on 2026-07-28

Support for Plugin Functional Pages is available from Base Library version 2.1.0 onwards.

Certain APIs cannot be called directly within a plugin (e.g., wx.login), but plugin developers can implement functionality using Plugin Functional Pages. Currently, Plugin Functional Pages include:

Starting from Base Library version 2.22.1, the following functional pages have been deprecated. You can directly call the corresponding APIs to implement the functionality:

Starting from Base Library version 2.16.1, the following three functional pages have been deprecated. You can directly call the corresponding APIs to implement the functionality; both existing and newly used <functional-page-navigator> components will no longer navigate to functional pages upon click, but will take effect directly:

To use Plugin Functional Pages, you must first activate the functional page feature, configure the corresponding functional page functions, and then use the functional-page-navigator component to navigate to the Plugin Functional Page to achieve the desired functionality. For details, please refer to the following sections.

Before using Plugin Functional Pages, ensure that the plugin has activated, otherwise issues such as no response after clicking functional-page-navigator may occur.

Plugin Owner Mini Program

Before starting development, we need to understand that a plugin functionality page refers to a special page within the plugin owner Mini Program .

Plugin owner Mini Program refers to the Mini Program with the same AppID as the plugin. For example, if the " Mini Program Sample" Mini Program develops a " Mini Program Sample Plugin," then no matter which Mini Program uses this plugin, the plugin owner Mini Program of this plugin is the " Mini Program Sample." The term plugin owner Mini Program will continue to be used in the following sections.

Plugin Owner Mini Program Development Approach

Typically, when starting to use plugin functional pages, two developer tools windows need to be opened: one for the plugin project and the other for the plugin owner Mini Program 's Mini Program project. For example, one window opens the " Mini Program Sample Plugin" project, while the other opens the " Mini Program Sample" project.

Regarding these two windows, the former is used for editing the plugin, and the latter is used for editing the plugin owner Mini Program. All content in the following text that requires editing the plugin owner Mini Program should be done in the latter window.

Functional Pages Feature

To invoke a plugin's Functional Page within a plugin, the Functional Pages feature of the plugin owner's Mini Program must first be enabled. Specifically, add the functionalPages definition section in the app.json file of the plugin owner's Mini Program, and set its value to true. Example:

Code Example:

{
 "functionalPages": {
 "independent": true
}
}

Currently, the legacy syntax is still compatible:

{
 "functionalPages": true
}

Support for the legacy syntax will be removed in the future, after which it will no longer be possible to compile and upload.

The difference between these two syntaxes is that the new syntax "independent": true makes the code of the Functional Pages independent from other code. This means that Functional Pages can be downloaded and loaded independently, offering better performance. However, this also means that files in the Functional Pages directory functional-pages/ (which files are used by the Payment Functional Page) cannot require files outside of this directory (and vice versa: files outside this directory cannot access files inside this directory).

Note that when adding or modifying this field, a new version of the Mini Program must be published to use the Functional Pages in the production environment.

Functional pages cannot be navigated to using wx.navigateTo. Instead, you must use the functional-page-navigator component. For example, to obtain user information, you can place the following functional-page-navigator in the plugin:

Code Example:

<functional-page-navigator name="loginAndGetUserInfo" args="" version="develop" bind:success="loginSuccess">
 <button>Log in to the plugin</button>
</functional-page-navigator>

When the user clicks this navigator, they will be automatically redirected to the corresponding functional page of the plugin owner's Mini Program. The functional page will prompt the user to log in or perform other relevant actions. The result of the action will be returned as a component event.

For parameters and detailed usage of functional-page-navigator, please refer to the Component Documentation.

Starting from the Mini Program base library version 2.4.0, it is supported for plugin owners to navigate to their own functional pages. If the base library version is lower than 2.4.0, clicking a functional-page-navigator that attempts to navigate to the owner's own functional page will have no effect.

Standard Steps for On-Device Development Testing

Currently, navigation to functional pages is not supported for debugging in the Developer Tools. Please test on a real device. When conducting on-device development testing for the first time, the typical steps are as follows:

  1. Open the plugin owner's Mini Program project in the Developer Tools and click "Preview";
  2. Scan the preview QR code with the test real device. This will enter the plugin owner's Mini Program. Once entered, you can directly exit this Mini Program;
  3. Open the plugin project in the Developer Tools and set the version attribute in functional-page-navigator to develop;
  4. Click "Preview" to generate the plugin preview QR code. Scan it with the test real device to preview the functional page. If you modify the plugin code, simply regenerate and scan the plugin preview QR code again;
  5. If you encounter a message such as "Development version expired" when navigating to the functional page after some time has passed, retry starting from Step 1.

Note: version=develop in functional-page-navigator is intended for debugging only. Therefore, before submitting the plugin for review, ensure the following:

  1. A plugin owner's Mini Program with "functionalPages": true configured has been published;
  2. All functional-page-navigator component attributes are set to version="release".

Frequently Asked Questions (FAQ) for the Feature Page

How to Correctly Edit the Plugin Owner Mini Program?

  • You should edit it in a project of the " Mini Program " type in the Developer Tools, rather than in a "Plugin" type project. For example, the owner Mini Program of the " Mini Program Example Plugin" is " Mini Program Example," and their AppID is wxidxxxxxxxxxxxxxx. If this is your first time developing the " Mini Program Example" Mini Program, you can create a Mini Program project in the Developer Tools with the AppID wxidxxxxxxxxxxxxxx. If you have previously developed the " Mini Program Example" Mini Program, simply open the previous Mini Program project.

Clicking functional-page-navigator has no effect.

  • Please check whether the Mini Program of the referenced plugin and the plugin itself have the same AppID. If they do, jumping to your own functional page requires WeChat Base Library 2.4.0 support. Otherwise, using functional-page-navigator will have no effect.

After clicking functional-page-navigator, a page is displayed indicating "Page does not exist".

  • This occurs because the plugin owner Mini Program has not correctly set "functionalPages": true. If functional-page-navigator has version="develop", this phone needs to scan the QR code and enter the plugin owner Mini Program once; if version="release", please ensure that the plugin owner Mini Program containing "functionalPages": true has been published.

After clicking <functional-page-navigator version="develop">, a pop-up message displays " Mini Program development version has expired".

  • If this occurs, simply scan the QR code again and enter the plugin owner's Mini Program once.

After clicking <functional-page-navigator name="requestPayment">, a page is displayed with the message "This feature is unavailable".

  • When using a plugin's functional page, the Mini Program must not be a personal Mini Program. Additionally, the plugin requires an extra step to apply for plugin payment permissions (located at "Basic Settings - Payment Capabilities" in the Management Console under " Mini Program Plugins").

After clicking <functional-page-navigator name="requestPayment">, click the "Pay" button on the page, and the payment functional page closes immediately.

  • This usually happens because the functional page function beforeRequestPayment cannot be found. Please check whether the functional-pages/request-payment.js file and the beforeRequestPayment function exist in the plugin owner's Mini Program.

After clicking functional-page-navigator, a page with only a back button is displayed.

It works in the development version, but the review feedback indicates that it cannot jump.

  • Please release the plugin owner who has set "functionalPages": true Mini Program, and ensure that the version attribute of all functional-page-navigator components is set to version="release".

Bugs & Tips

  • The functional page is a special page within the plugin owner's Mini Program. Developers cannot customize the appearance of this page.
  • The plugin owner's Mini Program itself can also reference this plugin. In this case, the version attribute of the functional-page-navigator component will not take effect; instead, it depends on the version of the plugin owner's Mini Program currently in use.
  • functional-page-navigator can be used in Developer Tools, but navigating to the functional page is not currently supported for debugging in Developer Tools. Please test on a real device.
  • Bug: In WeChat version 6.6.7, launching the functional page triggers part of the App's lifecycle, resulting in a longer startup time for the functional page. In subsequent WeChat versions, this behavior will change so that the App lifecycle is no longer triggered.