Remote Config
Remote Config is a feature that allows you to replace values or properties managed in your application with parameter values defined in the Hackle Dashboard, enabling real-time control of your application's behavior and configuration.
Navigate to the Remote Config screen on the Hackle Dashboard to configure parameter information and set values based on user identification rules.
remoteConfig
Calling the remoteConfig() method returns a HackleRemoteConfig instance containing the Remote Config information (configured parameters and rule information) for the user. remoteConfig() can receive user identifier information to match user properties against Remote Config rules. You can access the desired parameter and retrieve its value through the methods provided by HackleRemoteConfig.
hackleClient.onReady(function() {
// 원격 구성 정보를 담은 인스턴스를 반환합니다.
const remoteConfig = hackleClient.remoteConfig()
});Querying Remote Config Parameters
The
HackleRemoteConfigreturned by theremoteConfig()method provides aget()method for querying parameter values.Since parameter values configured in Hackle's Remote Config screen exist in key-value format, you can use the following method based on the configured parameter type to retrieve the configured parameter value.
Remove Remote Config-related code after archiving.
Once a Remote Config parameter is archived, you can no longer access parameter information. Therefore, after archiving a Remote Config parameter, be sure to clean up the related code.
hackleClient.onReady(function() {
// 원격 구성 정보를 담은 인스턴스를 반환합니다.
const remoteConfig = hackleClient.remoteConfig()
//remoteConfig 에서 get() 메소드를 통해 parameter 값 가져오기
const parameterValue = remoteConfig.get(parameterKey, defaultValue)
// string 유형의 parameter값 예제
const strValue = remoteConfig.get("parmeterKey", "defaultValue")
});The
parameterKeyin theget()method is the key configured in the Remote Config parameter settings.defaultValueis the value returned when the Remote Config value cannot be determined. ThedefaultValueyou entered may be returned in the following situations: A. ThedefaultValuetype does not match the parameter type configured on the Remote Config screen B. An unconfigured parameter key is called C. Hackle SDK initialization failure D. Invalid or non-existent identifier information is provided E. ETCTo correctly retrieve the configured value, you must enter a value of the type matching the parameter type you configured in
defaultValue.The Remote Config parameter types provided by the SDK are string, number, and boolean. The JSON type configured on the Remote Config parameter screen can be received as a string (String). The default value for JSON type must be entered as a string type.
Last updated