Remote Config

circle-info

This feature is supported in Javascript SDK version 11.7.3 and above.

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 HackleRemoteConfig returned by the remoteConfig() method provides a get() 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.

circle-exclamation
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 parameterKey in the get() method is the key configured in the Remote Config parameter settings.

  • defaultValue is the value returned when the Remote Config value cannot be determined. The defaultValue you entered may be returned in the following situations: A. The defaultValue type 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. ETC

  • To 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