Return Value
| Property | Type | Description |
|---|---|---|
| appId | String | The identifier of the current Mini Program |
The returned App ID depends on the deployment context:
- Deployed to AlipayCN: Returns the ID assigned by AlipayCN
- Other deployments: Returns the ID assigned by Mini Program Platform
Code Example
Use Cases
Conditional Logic Based on App ID
Logging and Analytics
Notes
- This is a synchronous operation that returns immediately
- The App ID is stable and does not change during the Mini Program lifecycle
- For AlipayCN deployments, cross-reference with the Mini Program Platform to find the official Mini Program ID
Related APIs
my.getRunScene
Get the running environment
my.SDKVersion
Get SDK version