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
withApiKey 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

NOTE: Before version 2.0.0, the withApiKey method was called withClientApiKey.

Return Value:
No value is returned.

Example:

Synerise.initializer()
  .withBaseUrl("YOUR_API_BASE_URL")
  .withApiKey("YOUR_PROFILE_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, [InitializationConfig? config]) async

NOTE: Before version 2.0.0, this method was called changeClientApiKey.

Parameters:

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Profile API Key (formerly Client API key)
config InitializationConfig no - Object for additional initialization settings after the API key change

Return Value:
No value is returned.

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 Profile Authentication requests.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.19.0 5.20.0 0.23.0 1.3.0
Declared In:
lib/synerise.dart

Class:
Synerise

Declaration:

static Future<void> changeApiKey(String apiKey, [InitializationConfig? config]) async

NOTE: Before version 2.0.0, this method was called changeClientApiKey.

Parameters:

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Profile API Key (formerly Client API key)
config InitializationConfig no - Object for additional initialization settings after the API key change

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.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.14.0 5.7.1 0.15.0 0.7.0
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.

Canonical URL: https://hub.synerise.com/developers/mobile-sdk/method-reference/flutter/lifecycle