title: Taro.getExtConfig(option)

sidebar_label: getExtConfig

Gets the data field customized by the third-party platform.

Tips

  • The compatibility of this API cannot be determined via Taro.canIUse currently. You need to figure out yourself whether Taro.getExtConfig exists and is compatible with the API.

Reference

Type

  1. (option?: Option) => Promise<SuccessCallbackResult>

Parameters

Option

Property Type Required Description
complete (res: any) => void No The callback function used when the API call completed (always executed whether the call succeeds or fails)
fail (res: any) => void No The callback function for a failed API call
success (res: Result) => void No The callback function for a successful API call

SuccessCallbackResult

Property Type Description
extConfig Record<string, any> Data customized by the third-party platform
errMsg string Call result

Sample Code

  1. if(Taro.getExtConfig) {
  2. Taro.getExtConfig({
  3. success: function (res) {
  4. console.log(res.extConfig)
  5. }
  6. })
  7. }

API Support

API WeChat Mini-Program H5 React Native
Taro.getExtConfig ✔️