
---
## Initialization
---
This method initializes Synerise.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

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

</div></div></div>

**Declared In:**  
lib/main/Synerise.js
  
**Related To:**  
[Synerise](/developers/mobile-sdk/class-reference/react-native/lifecycle#synerise)  
[SyneriseInitializer](/developers/mobile-sdk/class-reference/react-native/lifecycle#syneriseinitializer)  
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**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** | **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 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before version 1.0.0, the `withApiKey` method was called `withClientApiKey`.

</div></div></div>


**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1178">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1178-0" data-tab-group="tabgrp-1178" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1178-0" data-tab-group="tabgrp-1178" data-tab-active="true">

```JavaScript
Synerise.Initializer()
  .withBaseUrl("YOUR_API_BASE_URL")
  .withApiKey('YOUR_PROFILE_API_KEY')
  .withDebugModeEnabled(true)
  .withCrashHandlingEnabled(true)
  .withSettings({
    sdk: {
      enabled: true
    })
    .init();
```

</div>
</div>


## Change Profile API key dynamically
---
This method changes a Profile (formerly Client) API key dynamically.
**Declared In:**  
lib/main/Synerise.js
  
**Declaration:**  

<pre><code class="language-TypeScript">public static changeApiKey(ApiKey: string, config?: InitializationConfig | undefined)</code></pre>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before version 1.0.0, this method was called `changeClientApiKey`.

</div></div></div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiKey** | string | yes | - | New API key |
| **config** | [InitializationConfig](/developers/mobile-sdk/class-reference/react-native/lifecycle#initializationconfig) | no | - | Object for additional initialization settings after the API key change |
  
**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1179">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1179-0" data-tab-group="tabgrp-1179" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1179-0" data-tab-group="tabgrp-1179" data-tab-active="true">

```JavaScript
Synerise.changeApiKey(apiKey);
```

</div>
</div>


## 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](/developers/mobile-sdk/user-identification-and-authorization/simple-authentication) requests.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.19.0 | 5.20.0 | 0.23.0 | 1.3.0 |
**Declared In:**  
lib/main/Synerise.js
  
**Declaration:**  

<pre><code class="language-TypeScript">public static changeApiKey(ApiKey: string, config?: InitializationConfig | undefined)</code></pre>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before version 1.0.0, this method was called `changeClientApiKey`.

</div></div></div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiKey** | string | yes | - | New API key |
| **config** | [InitializationConfig](/developers/mobile-sdk/class-reference/react-native/lifecycle#initializationconfig) | no | - | Object for additional initialization settings after the API key change |
  
**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1180">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1180-0" data-tab-group="tabgrp-1180" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1180-0" data-tab-group="tabgrp-1180" data-tab-active="true">

```JavaScript
Synerise.changeApiKey(apiKey);
```

</div>
</div>
