SDK lifecycle
Initialization
This method initializes Synerise.
Declared In:
lib/main/Synerise.js
Related To:
Synerise
SyneriseInitializer
Class:
PromotionsModule
Builder Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
withBaseUrl | string | no | - | Synerise API custom environment base URL |
withClientApiKey | string | yes | - | Synerise Profile (formerly Client) API Key |
withDebugModeEnabled | boolean | no | - | Enables or disables console logs |
withCrashHandlingEnabled | boolean | no | - | Enables or disables crash handling |
withSettings | object | no | - | Settings that have to be configured before Synerise is initialized |
Return Value:
No value is returned.
Example:
Synerise.Initializer()
.withBaseUrl("YOUR_API_BASE_URL")
.withClientApiKey('YOUR_CLIENT_API_KEY')
.withDebugModeEnabled(true)
.withCrashHandlingEnabled(true)
.withSettings({
sdk: {
enabled: true
})
.init();
Change Profile API key dynamically
This method changes a Profile (formerly Client) API key dynamically.
Declared In:
lib/main/Synerise.js
Declaration:
public static changeClientApiKey(clientApiKey: string, config?: InitializationConfig | undefined)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
apiKey | string | yes | - | New API key |
config | InitializationConfig | no | - | Object for additional initialization settings after the API key change |
Return Value:
No value is returned.
Example:
Synerise.changeClientApiKey(apiKey);
Change Profile API Key dynamically with config
This method changes a Profile (formerly Client) API key dynamically, with additional parameters. It can include a salt for Simple Authentication requests.
Declared In:
lib/main/Synerise.js
Declaration:
public static changeClientApiKey(clientApiKey: string, config?: InitializationConfig | undefined)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
apiKey | string | yes | - | New API key |
config | InitializationConfig | no | - | Object for additional initialization settings after the API key change |
Return Value:
No value is returned.
Example:
Synerise.changeClientApiKey(apiKey);