In order to reduce the trouble for developers to update the application version frequently, the SolarEngine introduces online parameter functionality. By delivering parameters, the values of parameters in the application can be adjusted remotely at any time, allowing for application content updates without requiring a new release.
When using the online parameter SDK plug-in, it depends on the Web SDK .
Before officially starting data access, there are some parameters and SDK packages required. Follow the directions below to get prepared.
See the Web SDK integration documentation for details.
Click the link below to download the online parameter SDK plug-in package.
https://sdk.solar-engine.com/webabtest/SolarEngine-webabtest-SDK-1.3.0.zip
Since the Parameter Delivery SDK is a plugin of the SolarEngine SDK, the initialization of the Parameter Delivery SDK depends on the SolarEngine SDK. Please refer to the Android SDK integration documentation for specific details.
The SDK is built in UMD mode and supports multiple loading methods. Common loading methods are listed below:
import SESDK from './web-sesdk.js'
import webabtestPlugin from './sesdk-webabtest-plugin.js';
// Load online parameter SDK plug-in
SESDK.use(webabtestPlugin);
// Pre-initialization
SESDK.prevInit(appKey);
// SDK initialization
SESDK.init(initParams);
<script src="./web-sesdk.js"></script>
<script src="./sesdk-webabtest-plugin.js"></script>
// Load online parameter SDK plug-in
window.SESDK.use(window.webabtestPlugin);
// Pre-initialization
window.SESDK.prevInit(appKey);
// SDK initialization
window.SESDK.init(initParams);
initParams parameter description:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
userId | User Code obtained in preparation | String | YES |
appKey | AppKey obtained in preparation | String | YES |
config | Initialization related configuration | Config | NO |
Config parameter description:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
remoteConfig | Online parameters & A/B test configuration | RemoteConfig | NO |
multilinkTestConfig | Multi-link test configuration | MultilinkTestConfig | NO |
RemoteConfig parameter description:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
enable | Whether to initialize the online parameter SDK (Default false) | boolean | NO |
mergeType | Server and SDK merge type 0: Use the server configuration to merge with the user's local cache configuration. 1: Use the server configuration to merge with the user's default configuration | number | NO |
customIDProperties | Custom ID, matches the custom ID set by the user in the background | object | NO |
customIDEventProperties | Custom ID event property value, matches the custom ID event attribute value set by the user in the background. | object | NO |
customIDUserProperties | Custom ID user property value, matches the user attribute value set by the user in the background. | object | NO |
pollingInterval | Polling interval (unit: minutes), interval: 30 minutes-720 minutes, default 30 minutes | number | NO |
requestTimeout | Timeout for requesting configuration plug-in (Default 60*1000 milliseconds) | number | NO |
Multi-linkTestConfig parameter description:
Parameter | Type | Mandatory | Description |
---|---|---|---|
enable | boolean | NO | Whether to initialize the multi-link test SDK (default false) |
maskTimeoutCloseTime | number | NO | The timeout of multi-link test config request (default 500 milliseconds, minimum 200 milliseconds) |
isSetMask | boolean | NO | Whether to add a mask layer to the test page and prevent user operations before requesting a multi-link test configuration response. (default true). If you enable the mask layer, you need to put the SDK initialization logic in the head tag of the page, otherwise the page will flicker . |
customIDProperties | object | NO | Custom ID, matches the custom ID set by the user in the background |
customIDEventProperties | object | NO | Custom ID event property value, matches the custom ID event attribute value set by the user in the background. |
customIDUserProperties | object | NO | Custom ID user property value, matches the user attribute value set by the user in the background. |
requestTimeout | number | NO | Timeout for requesting configuration plug-in (Default 60*1000 milliseconds) |
Call example:
SESDK.init({
appKey: '666666',
userId: '888888',
config: {
debugModel: true,
remoteConfig: {
pollingInterval: 30,
enable: true,
mergeType: 1,
customIDProperties: { a: 1 },
customIDEventProperties: { e: 1 },
customIDUserProperties: { u: 1 },
},
multilinkTestConfig: {
enable: true,
isSetMask: true,
maskTimeoutCloseTime: 500,
customIDProperties: { a: 1 },
customIDEventProperties: { e: 1 },
customIDUserProperties: { u: 1 },
},
},
});
Developers who use parameters to deliver the SDK need to preset a default configuration into the App through the API. The SDK uses this default configuration as an alternative.
Method example:
SESDK.setRemoteDefaultConfig(defaultConfig)
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
defaultConfig | The default configuration passed by the developer | Array<object> | Yes |
defaultConfig example:
// defaultConfig defaultConfig default configuration. Each parameter configuration is an object, formatted as follows:
SESDK.setRemoteDefaultConfig([
{
name : "k1", // Name of the configuration item, corresponding to the parameter key of the fastFetchRemoteConfig interface
type : 1, // Type of the configuration item: 1 for string, 2 for number, 3 for boolean, 4 for json
value : "v1", // Value of the configuration item
}
]);
Developers can set custom attributes for events, and the parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
SESDK.setRemoteConfigEventProperties(properties)
Note: It must be set before SDK initialization.
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom event properties | object | Yes |
Call example:
SESDK.setRemoteConfigEventProperties({
k1: v1,
k2: v2
});
Developers can set custom attributes for users. The parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
SESDK.setRemoteConfigUserProperties(properties)
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom user properties | object | Yes |
Call example:
SESDK.setRemoteConfigUserProperties({
k1: v1,
k2: v2
});
The parameter delivery SDK provides two methods for retrieving parameter configuration: synchronous and asynchronous.
Note:
When retrieving parameters synchronously or asynchronously, the SDK will trigger an event to report which experiment the user is assigned to. Therefore, it is recommended to retrieve parameters when the user reaches the experimental scenario (retrieving parameters signifies that the user has reached the experimental scenario and entered the experiment associated with that parameter). Please refrain from retrieving parameters prematurely.
Method example:
SESDK.fastFetchRemoteConfig(key);
Note: It must be obtained after the SDK. The SESDK.ready method can be called to determine whether the SDK has completed initialization.
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
key | Parameter delivery key, corresponds to the parameter key configured by the user in the background. | String | Yes |
Return value type: id
Call example:
SESDK.ready(function(){
const v = SESDK.fastFetchRemoteConfig("k1");
// Operations after getting the value
})
Method example:
SESDK.asyncFetchRemoteConfig(key); //Return Promise
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
key | Parameter delivery key, corresponds to the parameter key configured by the user in the background. | String | Yes |
Call example:
SESDK.asyncFetchRemoteConfig("k1").then(function(value){
// Operations after getting the value
})
Developers can set custom attributes for events, and the parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
SESDK.setMultilinkTestEventProperties(properties)
Note: It must be set before SDK initialization.
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom event properties | object | Yes |
Call example:
SESDK.setRemoteConfigEventProperties({ k1: v1, k2: v2 });
Developers can set custom attributes for users. The parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
SESDK.setMultilinkTestUserProperties(properties)
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom user properties | object | Yes |
Call example:
SESDK.setMultilinkTestUserProperties({
k1: v1,
k2: v2
});
————————————
2025-03-14 1.3.0
• Align with the main SDK version
2025-03-13 1.2.9
• Align with the main SDK version
2025-02-13 1.2.8
• Align with the main SDK version
2025-01-03 1.2.7
• Align with the main SDK version
2024-12-10 1.2.4
• Align with the main SDK version
2024-11-29 1.2.3
• Align with the main SDK version
2024-11-11 1.2.2
• Align with the main SDK version
2024-10-31 1.2.1
•Align with the main SDK version
2024-09-26 1.2.0
• Align with the main SDK version
2024-08-14 1.1.9
• Align with the main SDK version
2024-05-22 1.1.8
• Align with the main SDK version
2024-04-22 1.1.7
• Align with the main SDK version
2024-04-16 1.1.6
• Align with the main SDK version
2024-04-01 1.1.5
• Align with the main SDK version
2024-03-15 1.1.4
• Request to add parameters for A/B testing
2024-03-01 1.1.3
• Fix initialization parameter issue in A/B testing.
2024-01-22 1.1.2
• Align with the main SDK version
2023-12-06 1.1.1
2023-11-02 1.1.0
2023-08-16 1.0.6
2023-08-08 1.0.5
2023-07-31 1.0.4
2023-06-01 1.0.3
2023-03-30 1.0.1
2023-03-20 1.0.0