Skip to main content
Use this API to determine feature availability before using version-specific functionality. This helps ensure graceful degradation on older Mini Program versions.

Parameters

Schema Syntax

The my.canIUse function accepts a dot-notation string to specify what feature to check:
Syntax: ${API}.${type}.${param}.${option}

Return Value

Code Examples

Check API Availability

Check API Parameter Support

Check Return Value Support

Check Component Attribute Support

Common Use Cases

Use my.canIUse to provide fallback behavior when features aren’t available:
Conditionally render UI elements based on platform capabilities:
Always check feature availability before using APIs that may not be present in all Mini Program versions. This ensures your app works correctly across different platform versions.