getCustomConfig
Requires:
Base library≥2.0.0@ray-js/ray≥1.7.29
Description
Retrieve custom Mini Program configuration. This API fetches custom business configuration defined in the Developer Console, supporting multiple data types (URL, boolean, number, string). Custom configuration supports hierarchical management with template-level and instance-level settings; instance settings take precedence over template settings. Changes are automatically synced to the cloud, and the Mini Program can use this API to obtain the latest configuration.
Parameters
Overload 1getCustomConfig(options: Object)→void
| Property | Type | Required | Description |
|---|---|---|---|
| No | Callback invoked when the API call succeeds; the argument is a key-value map of configuration items. | ||
| No | Failure callback | ||
| No | Completion callback (executed on both success and failure) |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | Error code |
| Error extension |
Overload 2getCustomConfig()→Promise<Record<string, string | number | boolean | string>>
None
Return Value
Type: void | Promise<Record<string, string | number | boolean | string>>
Returns a Promise when no callback is provided; the resolved value is an object of custom configuration key-value pairs
Error Code
| Error Code | Error Message |
|---|---|
7 | API internal processing failed |
Referenced Types
type
CustomConfigValueValue types for custom configuration items; supports string, number, and boolean