Skip to main content
Use this property to retrieve the current SDK version of the Mini Program basic library.
Do not rely on this value for code logic. This property is for reference and debugging purposes only.

Return Value

TypeDescription
StringThe version number of the basic library

Code Example

Page({
  onLoad() {
    // Get SDK version
    const version = my.SDKVersion;
    console.log('SDK Version:', version);
  },

  showVersion() {
    my.alert({
      content: `SDK Version: ${my.SDKVersion}`
    });
  }
});

Notes

  • This is a synchronous property access, not a function call
  • The version format follows semantic versioning (e.g., “1.2.3”)
  • Use my.canIUse instead for feature detection
For determining feature availability, always use my.canIUse() rather than checking the SDK version directly. This provides more reliable and maintainable code.

my.canIUse

Check if a feature is supported

my.getRunScene

Get the running environment