SDK Lifecycle
InitializationConfig
Class for additional initialization parameters.
Declared In:
lib/classes/models/Misc/InitializationConfig.js
Declaration:
class InitializationConfig
Properties:
Property | Type | Description |
---|---|---|
requestValidationSalt | string | Simple Authentication salt |
Synerise
Declared In:
lib/main/Synerise.js
Declaration:
class Synerise
Properties:
Property | Type | Description |
---|---|---|
Initializer | SyneriseInitializer | Returns the SyneriseInitializer object used for initialization |
Settings | SettingsModule | Returns the Settings module when Synerise is initialized |
Client | ClientModule | Returns the Client module when Synerise is initialized |
Tracker | TrackerModule | Returns the Tracker module when Synerise is initialized |
Notifications | NotificationsModule | Returns the Notifications module when Synerise is initialized |
Injector | InjectorModule | Returns the Injector module when Synerise is initialized |
Promotions | PromotionsModule | Returns the Promotions module when Synerise is initialized |
Content | ContentModule | Returns the Content module when Synerise is initialized |
Methods:
This method sets the callback function that is invoked when the Synerise SDK is initialized.
public static onReady(callback: () => void)
This method sets the callback function that is invoked when an error occurs while initializing the Synerise SDK.
public static onError(callback: (error: Error) => void)
This method checks if Synerise is initialized.
public static isInitialized(): boolean
This method changes the Profile API Key (formerly Client API Key) dynamically.
public static changeClientApiKey(clientApiKey: string, config?: InitializationConfig | undefined)
SyneriseInitializer
Class responsible for initialization of the SDK.
Declared In:
lib/main/Synerise.js
Declaration:
class SyneriseInitializer
Methods:
This method sets Profile API Key (formerly Client API Key) for the SDK initialization.
public withClientApiKey(clientApiKey: string)
This method sets the Synerise API base URL for SDK initialization in a custom environment.
public withBaseUrl(baseUrl: string)
This method sets the salt string for request validation.
public withRequestValidationSalt(requestValidationSalt: string)
This method enables or disables console logs from Synerise SDK.
public withDebugModeEnabled(debugModeEnabled: boolean)
This method enables or disables crash handling by Synerise SDK.
public withCrashHandlingEnabled(crashHandlingEnabled: boolean)
This method sets the required settings prior to the Synerise initialization.
public withSettings(settings: ISettingsOptions)
This method initializes Synerise.
public init()