Manage features

Features serve as an authorization mechanism that controls access to specific JSAPIs and open APIs. To ensure successful API calls, mini-program developers must add the corresponding features to their mini programs. This topic describes how to manage features in Mini Program Platform.

Before you begin

Before you begin, add the JSAPIs that are used to construct your feature. For more information, see JSAPI.

Create a feature

Features can be created only in a tenant workspace. To create a feature, perform the following steps:

  1. Log into Mini Program Platform and navigate to the Features page.
  2. On the Features page, click + Add Feature.
  3. On the Add New Feature page. Configure the following parameters:
    • Feature Name: the name of the feature.
    • Allow activation access by: Specify whether the feature can be directly accessed by developers. Options:
      • Direct access: Developers can directly access the feature.
      • Activation needed: Developers must apply for activation before they can access the feature.
    • Feature Description: the description of the feature.
    • Belongs to which workspace: the workspace to which the feature belongs.
    • All mini programs can view this feature: Specify whether the feature can be viewed by all mini programs in the workspace.
      • If you turn on the switch, the feature can be directly viewed by all the mini programs after it is created.
      • If you turn off the switch, the feature can be viewed only by mini programs with which the feature is shared after it is created.
  1. Configure JSAPIs of the feature. In the JSAPI area, select the JSPAIs that you want to add to the feature in the left column. Then click image.png to add the JSAPIs to the right column.

Note: You can also select the JSAPIs that you want to remove from the feature on the right column and click image.png to remove the JSAPIs.

  1. Click Confirm. The feature is successfully created and you can view the feature on the feature list.

Add a feature to a mini program

After you create a feature, you can add the feature to a mini program based on your business requirements. Refer to one of the following guides according to your workspace type to add a feature to a mini program:

For tenant workspaces

For tenant workspaces, only Workspace Admin can add a feature to a mini program by completing the following steps:

  1. Log into Mini Program Platform.
  2. (Optional) Share the feature with the mini program. Navigate to the Features page and click the feature you want to add. on the feature details page, go to Who will be able to view this tab and click +Share with to share the feature with the mini program.
  3. Navigate to Mini Programs > Wallet.
  4. Find and click the name of the mini program to which you want to add the feature.
  5. Click the Features tab and then + Add Feature. Select the feature that you want to add to the mini program and click Add. Then, the added feature is shown in the feature list of the mini program

For developer workspaces

For developer workspaces, only workspace owners and masters can add features to mini programs by completing the following steps:

  1. Log into Mini Program Platform and navigate to Mini Programs > Manage Mini Programs.
  2. Find and click the specific mini program to which you need to add a feature.
  3. Click the Features tab and then + Add Feature. Find the feature that you want to add to the mini program.
  4. (Optional) Activate the feature. If the feature is of the Activation needed type, click Activate in the Action column to apply for activation before you can add the feature to the mini program.
  5. Select the feature that you want to add to the mini program and click Add. Then, the added feature is shown in the feature list of the mini program and your mini program can access all the associated APIs.

Remove a feature from a mini program

If you want to remove a feature from a mini program, perform the following steps:

  1. Log into Mini Program Platform and navigate to Mini Programs.
  2. Find and click the mini program from which you want to remove a feature.
  3. Click the Features tab. In the feature list, find the feature that you want to remove from the mini program.
  4. Click Remove in the Action column.

More information