
---

## Set Client State listener
---
This method sets callbacks for a customer's state changes.
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Related To:**  
[ClientStateChangeListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#client-state-listener)  
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public setClientStateChangeListener(listener: IClientStateChangeListener)</code></pre>

  
**Discussion:**  
Learn more about the methods and the purpose of this listener [here](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#client-state-listener).

## Register customer account
---
This method registers a new customer with an email, password, and optional data.
  
This method requires the context object with a customer’s email, password, and optional data. Omitted fields are not modified.
  
Depending on the backend configuration, the account may require activation. For details, see  [customer registration](/developers/mobile-sdk/user-identification-and-authorization/overview).
  
Do not allow signing in again (or signing up) when a customer is already signed in. Sign the customer out first.
  
Do not create multiple instances nor call this method multiple times before execution.
  
This method is a global operation and doesn't require customer authentication.


<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 API key must have the `SAUTH_REGISTER_CLIENT_CREATE` permission from the **Client** group.

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

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

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **context** | [ClientAccountRegisterContext](/developers/mobile-sdk/class-reference/react-native/client#clientaccountregistercontext) | yes | - | Object with the customer's email, password, and other optional data |
| **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-1149">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1149-0" data-tab-group="tabgrp-1149" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
let email = "EMAIL";
let password = "PASSWORD";

let context = new ClientAccountRegisterContext(email, password);
context.phone = '123456789';
context.customId = '000111';

context.firstName = 'John';
context.lastName = 'Rise';
context.sex = ClientSex.Male;

context.company = 'Synerise';
context.address = 'Marszałkowska';
context.city = 'Warszawa';
context.province = 'Mazowieckie';
context.zipCode = '00-000';
context.countryCode = 'PL';

context.agreements = new ClientAgreements({
    email: true,
    sms: false,
    push: true,
    bluetooth: false,
    rfid: true,
    wifi: false
});

context.attributes = { ATTRIBUTE_1: 'ATTRIBUTE_1' }
context.tags = ['TAG_1', 'TAG_2']

Synerise.Client.registerAccount(context, function() {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Request customer account activation
---
This method requests sending an email with a URL that confirms the registration and activates the account.
  
This method is a global operation and doesn't require customer authentication.


<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 API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</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 requestAccountActivation(email: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</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 `activateAccount`.

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | string | yes | - | Customer's email |
| **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-1150">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1150-0" data-tab-group="tabgrp-1150" data-tab-active="true">TypeScript</button></div>

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

```TypeScript
Synerise.Client.requestAccountActivation("EMAIL", function() {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Confirm customer account activation
---
This method confirms a customer account with the confirmation token.
  
This method is a global operation and doesn't require customer authentication.


<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 the HTTP 400 status code if the account is already confirmed or 404 if the account does not exist.

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



<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 API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</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 confirmAccountActivation(token: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</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 `confirmAccount`.

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | string | yes | - | Customer's token provided by email |
| **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-1151">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1151-0" data-tab-group="tabgrp-1151" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Client.confirmAccountActivation("TOKEN", function() {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>



## Request customer account activation by pin
---
This method requests a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.


<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 API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</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 requestAccountActivationByPin(email: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

    
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | string | yes | - | Customer's email |
| **onSuccess** | Function | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | yes | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.

## Confirm customer account activation by pin
---
This method confirms a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.
  

<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 API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</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 confirmAccountActivationByPin(pinCode: string, email: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **pinCode** | string | yes | - | Code sent to a customer's email |
| **email** | string | yes | - | Customer's email |
| **onSuccess** | Function | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | yes | - | Function to be executed when the operation is completed with an error |

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

## Sign in a customer
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
**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 signIn(email: string, password: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | string | yes | - | Customer's email |
| **password** | string | yes | - | Customer's password |
| **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-1152">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1152-0" data-tab-group="tabgrp-1152" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
let email = "EMAIL";
let password = "PASSWORD";

Synerise.Client.signIn(email, password, function() {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Sign in a customer conditionally
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**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 signInConditionally(email: string, password: string, onSuccess: (authResult: ClientConditionalAuthResult) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | string | yes | - | Customer's email |
| **password** | string | yes | - | Customer's password |
| **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-1153">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1153-0" data-tab-group="tabgrp-1153" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
let email = "EMAIL";
let password = "PASSWORD";

Synerise.Client.signInConditionally(email, password, function(clientConditionalAuthResult) {
  // success
}, function(error) {
  // failure
});
```

</div>
</div>


## Authenticate customer by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
If an account for the customer does not exist and the identity provider is different than Synerise, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | 0.3.0 |
**Declared In:**  
lib/main/modules/ClientModule.js

**Related To:**  
[ClientAuthContext](/developers/mobile-sdk/class-reference/react-native/client#clientauthcontext)  
[ClientIdentityProvider](/developers/mobile-sdk/class-reference/react-native/client#clientidentityprovider)  
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public authenticate(token: string, provider: ClientIdentityProvider, context: ClientAuthContext, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | string | yes | - | Token retrieved from provider  |
| **clientIdentityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/react-native/client#clientidentityprovider) | yes | - | Provider of your token |
| **context** | [ClientAuthContext](/developers/mobile-sdk/class-reference/react-native/client#clientauthcontext) | yes | - | Object which wraps around agreements, attributes and authId |
| **onSuccess** | Function | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | yes | - | 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-1154">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1154-0" data-tab-group="tabgrp-1154" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Client.authenticate(token, ClientIdentityProvider.Oauth, context, function() {
  // success
}, function(error) {
  // failure
})
```

</div>
</div>


## Authenticate customer conditionally by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Related To:**  
[ClientAuthContext](/developers/mobile-sdk/class-reference/react-native/client#clientauthcontext)  
[ClientIdentityProvider](/developers/mobile-sdk/class-reference/react-native/client#clientidentityprovider)
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

<pre><code class="language-TypeScript">public authenticateConditionally(token: string, provider: ClientIdentityProvider, context: ClientAuthContext, onSuccess: (authResult: ClientConditionalAuthResult) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | string | yes | - | Token retrieved from provider |
| **clientIdentityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/react-native/client#clientidentityprovider) | yes | - | Provider of your token |
| **context** | [ClientAuthContext](/developers/mobile-sdk/class-reference/react-native/client#clientauthcontext) | no | - | Object which contains agreements, attributes, and identifier of authorization |
| **onSuccess** | Function | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | yes | - | 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-1155">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1155-0" data-tab-group="tabgrp-1155" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Client.authenticateConditionally(token, ClientIdentityProvider.Oauth, context, function(clientConditionalAuthResult) {
    // success
}, function(error) {
    // failure
})
```

</div>
</div>


## Authenticate customer via Simple Profile Authentication
---
This method authenticates a customer with Simple Profile Authentication.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
  

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

When you use this method, you must set a request validation salt by using the `Synerise.setRequestValidationSalt(_:)` method (if salt is enabled for Simple Profile Authentication).

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



<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 API key must have the `SAUTH_SIMPLE_AUTH_CREATE` from the **Auth** group.

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

**Declared In:**  
lib/main/modules/ClientModule.js

**Related To:**  
[ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/react-native/client#clientsimpleauthenticationdata)  
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **data** | [ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/react-native/client#clientsimpleauthenticationdata) | yes | - | Object which contains customer data |
| **authID** | string | yes | - | Required identifier of authorization |
| **onSuccess** | Function | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | yes | - | 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-1156">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1156-0" data-tab-group="tabgrp-1156" data-tab-active="true">TypeScript</button></div>

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

```TypeScript
let data: ClientSimpleAuthenticationData = new ClientSimpleAuthenticationData();
context.email = "EMAIL";
context.firstName = "FIRST_NAME";
let authID: String = "AUTH_ID"

Synerise.Client.simpleAuthentication(data, authID, function() {
  // success
}, function(error) {
  // failure
})
```

</div>
</div>


## Check if a customer is signed in (via RaaS, OAuth, Facebook, Apple)
---
This method checks if a customer is signed in (via Synerise Authentication - RaaS, OAuth, Facebook, Apple).
**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 isSignedIn(): boolean</code></pre>

  
**Return Value:**  
**true** if the customer is signed in, otherwise returns **false**.
  
**Example:**  

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

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

```JavaScript
let isSignedIn = Synerise.Client.isSignedIn();
```

</div>
</div>


## Check if a customer is signed in (via Simple Profile Authentication)
---
This method checks if a customer is signed in (via Simple Profile Authentication).
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.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 isSignedInViaSimpleAuthentication(): boolean</code></pre>

  
**Return Value:**  
**true** if the customer is signed in (via Simple Profile Authentication), otherwise returns **false**.
  
**Example:**  

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

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

```JavaScript
let isSignedIn = Synerise.Client.isSignedInViaSimpleAuthentication();
```

</div>
</div>


## Sign out a customer
---
This method signs out a customer out.
  

<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 works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</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 signOut()</code></pre>

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

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

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

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

</div>
</div>


## Sign out customer with mode or from all devices
---
This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices.

Available modes:
- `.signOut` mode signs out the customer.
- `.signOutWithSessionDestroy` mode signs out the customer and additionally, clears the anonymous session and regenerates the customer UUID.

The `fromAllDevices` parameter determines whether the method should notify the backend to sign out all devices.

**IMPORTANT: It is an asynchronous method.**
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.11.0 | 5.1.0 | 0.14.0 | 1.0.0 |


<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 works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

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

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

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/react-native/client#clientsignoutmode) | yes | - | Mode of signing out |
| **fromAllDevices** | Bool | yes | - | Determines if the method should sign out all devices |

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

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

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

```JavaScript
Synerise.Client.signOutWithMode(
  ClientSignOutMode.SignOutWithSessionDestroy,
  true,
  () => {
    this.setState({
      isLoading: false,
      isSignedIn: true,
    })
  },
  (error) => {
    this.setState({
      isLoading: false,
      isSignedIn: false,
    })

  console.log('ERROR: ' + error.message);
  }
)
```

</div>
</div>


## Deprecated methods

### Authenticate customer by OAuth with registration
---
This method authenticates a customer with OAuth.
  
If an account for the customer does not exist, this request creates an account.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<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 the HTTP 401 status code if the provided access token and/or API Key is invalid.

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

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

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


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | string | yes | - | OAuth Access Token |
| **clientOAuthContext** | [ClientOAuthAuthenticationContext](/developers/mobile-sdk/class-reference/react-native/client#clientoauthauthenticationcontext) | yes | - | Object which contains agreements, attributes, and identifier of authorization |
| **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-1161">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1161-0" data-tab-group="tabgrp-1161" data-tab-active="true">JavaScript</button></div>

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

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

</div>
</div>


### Authenticate customer by OAuth without registration
---
This method authenticates a customer with OAuth.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<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 the HTTP 401 status code if the provided access token and/or API Key is invalid.

</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 authenticateByOAuthIfRegistered(accessToken: string, authID: string | null, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | string | yes | - | OAuth Access Token |
| **authID** | string | no | null | Optional identifier of authorization |
| **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 |
  

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

**authID** 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.
  
**Example:**  

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

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

```JavaScript
Synerise.Client.authenticateByOAuthIfRegistered(accessToken, authID, function() {
   // success
}, function(error) {
   // failure
})
```

</div>
</div>


### Authenticate customer by Facebook with registration
---
This method authenticates a customer with Facebook.
  
If an account for the customer does not exist, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<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 the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

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

**Declared In:**  
lib/main/modules/ClientModule.js

**Related To:**  
[ClientFacebookAuthenticationContext](/developers/mobile-sdk/class-reference/react-native/client#clientfacebookauthenticationcontext)
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

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

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | string | yes | - | Facebook Access Token |
| **clientFacebookAuthenticationContext** | [ClientFacebookAuthenticationContext](/developers/mobile-sdk/class-reference/react-native/client#clientfacebookauthenticationcontext) | yes | - | Object which contains agreements, attributes, and identifier of authorization |
| **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-1163">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1163-0" data-tab-group="tabgrp-1163" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Client.authenticateByFacebook(token, clientFacebookAuthenticationContext, function(clientConditionalAuthResult) {
  // success
}, function(error) {
  // failure
})
```

</div>
</div>


### Authenticate customer by Facebook without registration
---
This method authenticates a customer with Facebook.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<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 the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

</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 authenticateByFacebookIfRegistered(facebookToken: string, authID: string | null, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | string | yes | - | Facebook Access Token |
| **authID** | string | no | null | Optional identifier of authorization |
| **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 |
  

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

**authID** 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.

**Example:**  

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

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

```JavaScript
Synerise.Client.authenticateByFacebookIfRegistered(facebookToken, authID, function() {
    // success
}, function(error) {
    // failure
})
```

</div>
</div>


### Authenticate customer by Sign in with Apple with registration
---
This method authenticates a customer with Sign In With Apple.
  
If an account for the customer does not exist, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | n/a | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | n/a | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | n/a | 1.0.0 | n/a |
**Declared In:**  
lib/main/modules/ClientModule.js
  
**Related To:**  
[ClientAppleSignInAuthenticationContext](/developers/mobile-sdk/class-reference/react-native/client#clientapplesigninauthenticationcontext)
  
**Class:**  
[ClientModule](/developers/mobile-sdk/class-reference/react-native/modules#client)
  
**Declaration:**  

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


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **identityToken** | string | yes | - | Apple Identity Token |
| **context** | [ClientAppleSignInAuthenticationContext](/developers/mobile-sdk/class-reference/react-native/client#clientapplesigninauthenticationcontext) | yes | - | Object which contains agreements, attributes, and identifier of authorization |
| **success** | Function | no | - | Function to be executed when the operation is completed successfully |
| **failure** | Function | no | - | Function to be executed when the operation is completed with an error |

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

### Authenticate customer by Sign in with Apple without registration
---
This method authenticates a customer with Sign In With Apple.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
**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 authenticateByAppleSignInIfRegistered(identityToken: string, authID: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **identityToken** | string | yes | - | Apple Identity Token |
| **authID** | string | no | null | Optional identifier of authorization |
| **success** | Function | no | - | Function to be executed when the operation is completed successfully |
| **failure** | Function | no | - | Function to be executed when the operation is completed with an error |
  

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

**authID** 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.





