Skip to content

LaunchMiniProgram

Parameters

PropertyTypeDefault ValueRequiredDescription
userNamestringYesThe original ID of the mini-program, e.g., gh_d43f693ca31f. Click here to see how to obtain it
pathstringDefault to open the mini-program homepageNoThe optional path to open a specific page within the mini-program, e.g., "?foo=bar".
miniprogramTypenumberDefaults to release versionNoOptional: 0 - Release version, 1 - Development version, 2 - Experience version

Example

javascript
window.Wechat.launchMiniProgram({
  userName: "gh_67210fc11b59", 
}, function(res) {
     console.log('launch mini program success!');
}, function(err) {
     console.error(err);
  }
);

Apache 2.0 License.