Configuration field reference

This topic explains the usage and entry tips for each configuration field of mini programs. Proper configuration ensures that your mini program functions correctly and meets business and security requirements.

Note: This topic is intended for super apps. To guide merchants through the configuration, refer to Configuration field reference (for merchants).

Overview

The table below provides a glance at the configuration fields, their purpose, and the configuration levels (global or release-specific) in which they are available. Use it to quickly identify the fields you need to configure, then proceed to the detailed sections for specific instructions:

Configuration field

Purpose

Configuration level

Client ID, Merchant ID

  • Payment processing
  • Trusted identity establishment

Both global and release-specific

Server Domains, WAP URLs

Network security allowlist

Both global and release-specific

Testers

Internal testing

Both global and release-specific

Environment Variables

  • Environment-specific settings
  • Sensitive information storage

Release-specific only

Note: Ensure your entries are correct and specific for each configuration level:

  • Global configuration applies to all new mini program versions and IDE previews.
  • Release-specific configuration applies to a particular version, target app, and environment combination.

Field details

See the field details in the following sections:

Client ID and Merchant ID

Use these fields to establish your identity for payment processing with your acquirer or for authentication within the super app.

  • Definitions:
    • Client ID: A unique ID assigned by your acquirer to identify a specific payment scenario of the merchant.
    • Merchant ID: A unique ID assigned by your acquirer or the super app to identify your merchant identity.
  • When to configure: Configure these IDs if all the following conditions are met:
    • Your mini program needs to process payments or establish a trusted identity for authentication within the super app.
    • The SDK that the target app integrates with does not provide the values.
    • (Client ID only) Your mini program uses the my.tradePay JSAPI to initiate payments.
  • Where to configure: Both global and release-specific configuration.
  • How to configure:
    • Global configuration: Set IDs for each supported environment if the target app works across multiple environments. For each environment, use either an environment-specific or universal ID as instructed by the super app or your acquirer.
    • Release-specific configuration: Set the ID for the target environment of the specific release. Use either an environment-specific or universal ID as instructed by your acquirer.

Server Domains and WAP URLs

Use these fields to define a secure allowlist of web resources, ensuring your mini program only interacts with trusted endpoints.

  • Definitions:
    • Server Domains: Allowed server domains that your mini program can communicate with in certain JSAPI requests. For example:
    • WAP URLs: Allowed mobile page URLs that can be loaded within the web-view component of your mini program.
  • When to configure: By default, these two fields are non-editable and your mini program can access all server domains and mobile pages. Configure these fields if you need to restrict access to only trusted endpoints.
  • Where to configure: Both global and release-specific configuration.
  • How to configure:
    1. Enable edit permission: To edit these fields, ensure the mini program has the required permission. For instructions, see Grant permissions for configuring server domains and WAP URLs authorization. Note that if the permission is granted but the fields are left empty, the mini program will lose access to all server domains and mobile pages (including your own domains).
    2. Configure allowlists: Enter each domain or URL in a separate row in the provided input boxes. All entries must use the HTTPS protocol.

Testers

Use this field to manage a list of users who can access your mini program for testing before it goes live.

  • Definition: A list of super app user IDs representing testers who can access your mini program before it goes live.
  • When to configure: Set testers when you plan to test a new mini program release.
  • Where to configure: Both global and release-specific configuration.
  • How to configure: Select either of the following options to add testers:
      • Add by Manual Entry: Enter the super app user IDs directly into the input box. Enter one ID per row, with a maximum of 150 testers. Note that long user IDs might reduce the allowed count. If you encounter issues saving the list, try reducing the number of testers.
      • Add by File Upload: Upload a CSV or TXT file containing the super app user IDs. Use the template provided on the interface and ensure the file does not exceed 100 KB. For optimal performance, it is recommended to limit the number of testers to 1,000 or fewer.

Environment Variables

Note: This feature is only available for DSL mini programs and must be enabled first. To enable the feature, see Enable environment variables for your platform.

Use this field to pass environment-specific configuration values and sensitive information securely.

  • Definition: A set of custom key-value pairs where the value is specific to a certain deployment environment.
  • When to configure: Set environment variables for the following cases:
    • You need different settings (such as API endpoints) for different release environments.
    • You need secure storage for sensitive information.
  • Where to configure: Release-specific configuration only.
  • How to configure:
    • Add the variable names and their corresponding values. You can specify up to five environment variables per release.
    • Default values: When you create a new release for the same target app and environment, the environment variables from your previous Full Release version are automatically pre-filled. You can review and modify these values for the new release.