SDK lifecycle


Initialization


This method initializes Synerise.

Note: This method must be called before any other Synerise SDK method and only once during the application’s lifecycle.

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);

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker