Remote Config Appliance

📘

Remote Config

Remote config controls the behavior and settings of an application in real-time by replacing the values or properties controlled in application with the parameters defined in the hackle dashboard. The parameter can be set to a target value for all properties of the client/server side app (ex. button color, external link).

First, set parameter information and values according to user identifier rules in Hackle's dashboard. In order to apply the remote config, you need to use the following functions provided by the Hackle SDK.

After applying the values ​​to be applied to the code provided by the Hacker SDK, you can simply change the values ​​and rules on the remote config to apply the changes immediately without republishing.

📘

Remote Configs are only available for SDK version 11.7.3 or higher.

When using remote configs, please apply SDK version 11.7.3 or higher when adding dependencies.

useRemoteConfig() or useLoadableRemoteConfig()

By using useRemoteConfig() or useLoadableRemoteConfig() Hooks API, you can get a HackleRemoteConfig instance that contains remote configuration information (set parameters and rule information) for the user.
Through methods provided by HackleRemoteConfig, you can access desired parameters and receive values.

// Returns an instance containing remote config information. 
const remoteConfig = useRemoteConfig()

// When using SSR
const { isLoading, remoteConfig } = useLoadableRemoteConfig()

Remote config parameter inquiry

  • HackleRemoteConfig returned using useRemoteConfig() or useLoadableRemoteConfig() Hooks API provides get() method to retrieve parameter values.
  • Since the parameter values ​​set in the Hackle's Dashboard exist in the form of key and value, the set parameter value can be returned using the method below according to the set parameter type.

🚧

Remove code related to the Remote Config after archiving the parameter key

If the code related to Remote Config is left unattended after your parameter key has been archived and you've long forgotten about it, service stability problems such as latency issues may occur.

hackleClient.onReady(function() {
// Returns an instance containing remote config information. 
const remoteConfig = useRemoteConfig()

//Get parameter value through get() method in remoteConfig
const parameterValue = remoteConfig.get(parameterKey, defaultValue)

// String type parameter value example
const strValue = remoteConfig.get("parmeterKey", "defaultValue")




// When using SSR 
// Returns an instance containing remote config information. 
const { isLoading, remoteConfig } = useLoadableRemoteConfig()

//Get parameter value through get() method in remoteConfig
const parameterValue = remoteConfig.get(parameterKey, defaultValue)

// String type parameter value example
const strValue = remoteConfig.get("parmeterKey", "defaultValue")
  • The parameterKey of the get() method is the key information set in parameter setting of remote config.
  • You can refer parameterKey from the dashboard, defaultValue is the value returned when a state decision fails or when an invalid parameter type is entered
    • A. Entered a different parameter type and defaultValue in the dashboard
    • B. Calling unset parameter key
    • C. Hackle SDK initialization failure
    • D. When identifier information is entered incorrectly or does not exist
    • E. ETC
  • In order to properly receive the information you set in the dashboard, you must enter a value corresponding to the parameter type you set in the dashboard.
  • The parameter types supported by SDK are string, number, and boolean. JSON types set in the dashboard can be received in the form of String. The default value of the JSON type must be entered as a string type.