Skip to main content
Use this API to determine whether the Mini Program is running in a development or production environment.

Parameters

Success Callback

Fail Callback

Error Codes

Code Example

Basic Usage

Using with async/await

Conditional Feature Loading

Display Environment Badge

Use Cases

Enable verbose logging only in development:
Switch between development and production APIs:
Enable experimental features in development:

my.getAppIdSync

Get the App ID

my.canIUse

Check feature support