Skip to main content

setConfiguration()

Applies a runtime configuration object to SDK panels, overriding server-side defaults.

Description​

Applies an assocArray of panel configuration settings to the SDK. The configuration is applied immediately to any panels already built and is automatically applied to panels built afterward. This function is the programmatic equivalent of setting the configuration field.

Usage​

m.lib.callFunc("setConfiguration", {
stats: {
refreshInterval: 30
}
})

Return Value​

boolean — Returns true when the configuration object was accepted, or false if the supplied argument is not a valid assocArray.

When to Use​

Use setConfiguration() when you need to:

  • Confirm programmatically that the configuration object was accepted (via the return value).
  • Apply configuration from a callback or function scope where field assignment is not available.

For declarative setup, prefer the configuration field.

Best Practices​

  • Call setConfiguration() before or after config is set — the SDK applies it whenever it arrives, including after panels are already built.
  • Pass only the keys your integration needs; the SDK preserves server-side defaults for any keys not present in the supplied object.
  • Check the return value when supplying configuration from an external source to detect malformed inputs early.

See also: configuration