
---
## Refresh customer token
---
This method refreshes the customer’s current token.
  

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

Returns an error if the token has expired and cannot be refreshed.

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

**Declared In:**  
lib/main/modules/ClientModule.js
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public refreshToken(onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.
  
**Example:**  

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

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

```JavaScript
Synerise.Client.refreshToken(function(token) {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Retrieve customer token
---
This method retrieves the customer’s current, active token.
  

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

Returns an error if the token has expired and cannot be retrieved.

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

**Declared In:**  
lib/main/modules/ClientModule.js
  
**Related To:**  
[Token](/developers/mobile-sdk/class-reference/react-native/client#token)
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public retrieveToken(onSuccess: (token: Token) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

**Example:**  

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

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

```JavaScript
Synerise.Client.retrieveToken(function(token) {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Get current customer UUID
---
This method retrieves the customer’s current UUID.
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getUUID(): string</code></pre>

  
**Return Value:**  
The method returns the customer's UUID as string.

**Example:**  

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

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

```JavaScript
let uuid = Synerise.Client.getUUID();
```

</div>
</div>


## Regenerate customer
---
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
  
This operation works only if the customer is anonymous.

This operation clears the authentication token, login (if applicable), custom email, and custom identifier.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.10 | 3.3.5 | 0.9.0 | 0.7.0 |
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public regenerateUUID()</code></pre>


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

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

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

```JavaScript
Synerise.Client.regenerateUUID();
```

</div>
</div>


## Regenerate customer with identifier
---
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
  
This operation works only if the customer is anonymous.
  
This operation clears the authentication token, login (if applicable), custom email, and custom identifier
  
The optional `clientIdentifier` parameter is a seed for UUID generation.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.5 | 3.6.4 | 0.9.10 | 0.7.2 |
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public regenerateUUIDWithClientIdentifier(clientIdentifier: string)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **clientIdentifier** | string | no | - | Seed for UUID generation |


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

The **clientIdentifier** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

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


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

## Destroy current session
---
This method destroys the session completely.

This method clears all session data (both client and anonymous) and removes cached data. Then, it regenerates the UUID and creates the new anonymous session.
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public destroySession()</code></pre>

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

**Example:**  

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

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

```JavaScript
Synerise.Client.destroySession();
```

</div>
</div>
