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_initializer.dart

Class:
Synerise
SyneriseInitializer

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 bool no - Enables or disables console logs
withCrashHandlingEnabled bool no - Enables or disables crash handling
setRequestValidationSalt String no - Sets salt string for request validation

Return Value:
No value is returned.

Example:

Synerise.initializer()
  .withBaseUrl("YOUR_API_BASE_URL")
  .withClientApiKey("YOUR_CLIENT_API_KEY")
  .withDebugModeEnabled(false)
.init();

Change Profile API Key dynamically


This method changes a Profile (formerly Client) API key dynamically.

Declared In:
lib/synerise.dart

Class:
Synerise

Declaration:

static Future<void> changeApiKey(String apiKey) async {

Parameters:

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Profile API Key (formerly Client API key)

Return Value:
No value is returned.

Set up Debug Mode


This method enables or disables console logs from Synerise SDK.

WARNING: It is not recommended to use debug mode in the release version of your application.

Declared In:
lib/main/synerise_initializer.dart

Class:
Synerise

Declaration:

.withDebugModeEnabled(bool debugModeEnabled)

Parameters:

Parameter Type Mandatory Default Description
enabled Bool yes - Enables or disables console logs

Return Value:
No value is returned.

Enable Crash Handling


This method enables or disables crash handling by Synerise SDK.

Note: If set to true, Synerise SDK will send the client.applicationCrashed event with information about crash.

Declared In:
lib/main/synerise_initializer.dart

Class:
Synerise

Declaration:

.withCrashHandlingEnabled(bool crashHandlingEnabled)

Parameters:

Parameter Type Mandatory Default Description
enabled Bool yes - Enables or disables crash handling

Return Value:
No value is returned.

Set Request Validation Salt


This method sets the salt string for request validation.

Declared In:
lib/main/synerise_initializer.dart

Class:
Synerise

Declaration:

.setRequestValidationSalt(String requestValidationSalt) 

Parameters:

Parameter Type Mandatory Default Description
string String yes - Synerise Profile salt string for request validation

Return Value:
No value is returned.

😕

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