
---
## 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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)


<div class="content-tabs" data-tab-group="tabgrp-910">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-910-0" data-tab-group="tabgrp-910" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-910-1" data-tab-group="tabgrp-910">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; registerAccount(ClientAccountRegisterContext context, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **context** | [ClientAccountRegisterContext](/developers/mobile-sdk/class-reference/flutter/client#clientaccountregistercontext) | yes | - | Object with the customer's email, password, and other optional data |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">ClientAccountRegisterContext clientAccountRegisterContext = ClientAccountRegisterContext(email: email, password: password);

await Synerise.client.registerAccount(clientAccountRegisterContext, onSuccess: () {
  //onSuccess handling
}, onError: (SyneriseError error) {
  //onError handling
});</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-910-1" data-tab-group="tabgrp-910">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; registerAccount(ClientAccountRegisterContext context) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **context** | [ClientAccountRegisterContext](/developers/mobile-sdk/class-reference/flutter/client#clientaccountregistercontext) | yes | - | Object with the customer's email, password, and other optional data |

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

<pre><code class="language-Dart">await Synerise.client.registerAccount(clientAccountRegisterContext).catchError((error)</code></pre>

</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/modules/client/client_impl.dart  
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)


<div class="content-tabs" data-tab-group="tabgrp-911">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-911-0" data-tab-group="tabgrp-911" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-911-1" data-tab-group="tabgrp-911">Legacy SDK</button></div>

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

**Declaration:**    

<pre><code class="language-Dart">Future&lt;void&gt; requestAccountActivation(String email,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


Before version 2.0.0, this method was called `activateAccount`
    
**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([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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

<pre><code class="language-Dart">await Synerise.client.synerise-flutter-sdkAccount(email, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-911-1" data-tab-group="tabgrp-911">

**Declaration:**    

<pre><code class="language-Dart">Future&lt;void&gt; activateAccount(String email) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer’s email |

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

<pre><code class="language-Dart">await Synerise.client.activateAccount(email).catchError((error)</code></pre>

</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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-912">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-912-0" data-tab-group="tabgrp-912" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-912-1" data-tab-group="tabgrp-912">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; confirmAccountActivation(String token, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</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() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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

<pre><code class="language-Dart">await Synerise.client.confirmAccountActivation(token, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-912-1" data-tab-group="tabgrp-912">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; confirmAccountActivation(String token) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | String | yes | - | Customer’s token provided by email |

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

<pre><code class="language-Dart">await Synerise.client.confirmAccount(token).catchError((error)</code></pre>

</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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-913">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-913-0" data-tab-group="tabgrp-913" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-913-1" data-tab-group="tabgrp-913">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; requestAccountActivationByPin(String email, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **email** | String | yes | Customer's email |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.
  
**Example:**

<pre><code class="language-Dart">await Synerise.client.requestAccountActivationByPin(email, onSuccess: () {
  //onSuccess handling
}, onError: (SyneriseError error) {
  //onError handling
});</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-913-1" data-tab-group="tabgrp-913">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; requestAccountActivationByPin(String email) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **email** | String | yes | Customer's email |
  
**Return Value:**  
No value is returned.
  
**Example:**

<pre><code class="language-Dart">await Synerise.client.requestAccountActivationByPin(email).catchError((error) {</code></pre>

</div>
</div>


## 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/modules/client/client_impl.dart

**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-914">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-914-0" data-tab-group="tabgrp-914" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-914-1" data-tab-group="tabgrp-914">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; confirmAccountActivationByPin(String email, String pinCode, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | 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([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | Function to be executed when the operation is completed with an error |

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

<pre><code class="language-Dart">await Synerise.client.confirmAccountActivationByPin(email, pinCode, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-914-1" data-tab-group="tabgrp-914">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; confirmAccountActivationByPin(String email, String pinCode) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **pinCode** | String | yes | Code sent to a customer's email |
| **email** | String | yes | Customer's email |
  
**Return Value:**  
No value is returned.
  
**Example:**

<pre><code class="language-Dart">await Synerise.client.confirmAccountActivationByPin(email, pinCode).catchError((error) {</code></pre>

</div>
</div>


## 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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-915">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-915-0" data-tab-group="tabgrp-915" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-915-1" data-tab-group="tabgrp-915">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signIn(String email, String password, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer’s email |
| **password** | String | yes | - | Customer’s password |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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

**Example:**  

<pre><code class="language-Dart">await Synerise.client.signIn(email, password, onSuccess: () {
  //onSuccess handling
}, onError: (SyneriseError error) {
  //onError handling
});</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-915-1" data-tab-group="tabgrp-915">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signIn(String email, String password) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer’s email |
| **password** | String | yes | - | Customer’s password |

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

**Example:**  

<pre><code class="language-Dart">await Synerise.client.signIn(email,password).catchError((error)</code></pre>

</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/modules/client/client_impl.dart
  
**Related To:**  
[ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthresult)  

**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-916">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-916-0" data-tab-group="tabgrp-916" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-916-1" data-tab-group="tabgrp-916">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signInConditionally(String email, String password,
      {required void Function(ClientConditionalAuthResult) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **email** | String | yes | Customer's email |
| **password** | String | yes | Customer's password |
  
**Return Value:**  
No value is returned.
  
**Example:**

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

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

```Dart
await Synerise.client.signInConditionally(email, password, onSuccess: (ClientConditionalAuthResult result) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });
```

</div>
</div>

</div>

<div class="tab-panel" data-tab-id="tabgrp-916-1" data-tab-group="tabgrp-916">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;ClientConditionalAuthResult&gt; signInConditionally(String email, String password) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **email** | String | yes | Customer's email |
| **password** | String | yes | Customer's password |
  
**Return Value:**  
[ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthresult)
  
**Example:**

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

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

```Dart
await Synerise.client.signInConditionally(email, password).catchError((error)
```

</div>
</div>

</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/modules/client/client_impl.dart  
  
**Related To:**  
[ClientAuthContext](/developers/mobile-sdk/class-reference/flutter/client#clientauthcontext)  
[ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider)  
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)


<div class="content-tabs" data-tab-group="tabgrp-917">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-917-0" data-tab-group="tabgrp-917" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-917-1" data-tab-group="tabgrp-917">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; authenticate(ClientAuthContext clientAuthContext, IdentityProvider identityProvider, String tokenString,
    {required void Function(bool) onSuccess, required void Function(SyneriseError) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **clientAuthContext** | [ClientAuthContext](/developers/mobile-sdk/class-reference/flutter/client#clientauthcontext) | yes | - | Object which contains agreements, attributes, and identifier of authorization |
| **identityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider) | yes | - | Provider of your token |
| **tokenString** | String | yes | - | Token retrieved from provider |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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

<pre><code class="language-Dart">await Synerise.client.authenticate(clientAuthContext, identityProvider, tokenString, onSuccess: (bool result) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-917-1" data-tab-group="tabgrp-917">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;bool&gt; authenticate(ClientAuthContext clientAuthContext, IdentityProvider identityProvider, String tokenString) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **clientAuthContext** | [ClientAuthContext](/developers/mobile-sdk/class-reference/flutter/client#clientauthcontext) | yes | - | Object which contains agreements, attributes, and identifier of authorization |
| **identityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider) | yes | - | Provider of your token |
| **tokenString** | String | yes | - | Token retrieved from provider |
  
**Return Value:**  
**true** if the operation is success, otherwise it throws an error.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.client.authenticate(clientAuthContext, identityProvider, tokenString).catchError((error)</code></pre>

</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/modules/client/client_impl.dart

**Related To:**  
[ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthresult)  
[ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider)
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-918">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-918-0" data-tab-group="tabgrp-918" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-918-1" data-tab-group="tabgrp-918">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; authenticateConditionally(ClientAuthContext clientAuthContext, IdentityProvider identityProvider, String tokenString,
    {String? authID, required void Function(ClientConditionalAuthResult) onSuccess, required void Function(SyneriseError) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Optional | Description |
| --- | --- | --- | --- |
| **clientAuthContext** | [ClientAuthContext](/developers/mobile-sdk/class-reference/flutter/client#clientauthcontext) | no | Object which contains agreements and attributes |
| **identityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider) | no | Provider of your token |
| **tokenString** | String | no | Token retrieved from provider |
| **authID** | String | yes | Optional identifier of authorization |
| **onSuccess** | Function([ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthresult) result) | yes | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | 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:**  

<pre><code class="language-Dart">Token token = Token(tokenString: "tokenString", origin: TokenOrigin.anonymous, expirationDate: DateTime;
    await Synerise.client.retrieveToken(onSuccess: (Token token) {
      token = token;
    }, onError: (SyneriseError error) {
    //onError handling
    });
    String tokenString = token.tokenString;
    IdentityProvider identityProvider = IdentityProvider.oauth;
    
    await Synerise.client.authenticateConditionally(identityProvider, tokenString, onSuccess: (ClientConditionalAuthResult result) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-918-1" data-tab-group="tabgrp-918">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;ClientConditionalAuthResult&gt; authenticateConditionally(ClientAuthContext clientAuthContext, IdentityProvider identityProvider, String tokenString) async</code></pre>


**Parameters:**  
| Parameter | Type | Optional | Description |
| --- | --- | --- | --- |
| **token** | String | no | Token retrieved from provider |
| **clientIdentityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/flutter/client#clientidentityprovider) | no | Provider of your token |
| **authID** | String | yes | Optional identifier of authorization |
| **context** | [ClientConditionalAuthContext](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthcontext) | no | Object which contains agreements and attributes |
  

<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:**  
[ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/flutter/client#clientconditionalauthresult)
  
**Example:**

<pre><code class="language-Dart">ClientAgreements? agreements = ClientAgreements(push: false, rfid: false, wifi: false);
    Map&lt;String, Object&gt;? attributes;
    ClientAuthContext clientAuthContext = ClientAuthContext(authId: 'AUTH_ID', agreements: agreements, attributes: attributes);
    Token token = await Synerise.client.retrieveToken().catchError((error) {
      String errorMessage = Utils.handlePlatformException(error);
      Utils.displaySimpleAlert("error on handling api call \n $errorMessage", context);
      throw Exception(errorMessage);
    });
    String tokenString = token.tokenString;
    IdentityProvider identityProvider = IdentityProvider.oauth;
    
    ClientConditionalAuthResult result =
        await Synerise.client.authenticateConditionally(clientAuthContext, identityProvider, tokenString).catchError((error) {
      String errorMessage = Utils.handlePlatformException(error);
      Utils.displaySimpleAlert("error on handling api call: you need to be signed in to authenticate \n $errorMessage", context);
      throw Exception(errorMessage);
    });</code></pre>

</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/modules/client/client_impl.dart
  
**Related To:**  
[ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/flutter/client#clientsimpleauthenticationdata)  
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-919">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-919-0" data-tab-group="tabgrp-919" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-919-1" data-tab-group="tabgrp-919">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; simpleAuthentication(ClientSimpleAuthenticationData data, String authID, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **data** | [ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/flutter/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([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | 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:**  

<pre><code class="language-Dart">ClientSimpleAuthenticationData data =
        ClientSimpleAuthenticationData(firstName: firstName, lastName: lastName, email: email, customId: customID);
    await Synerise.client.simpleAuthentication(data, authID, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-919-1" data-tab-group="tabgrp-919">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; simpleAuthentication(ClientSimpleAuthenticationData clientSimpleAuthenticationData, String authID) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **data** | [ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/flutter/client#clientsimpleauthenticationdata) | yes | - | Object which contains customer data |
| **authID** | String | yes | null | Required identifier of authorization |
  

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

</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/modules/client/client_impl.dart

**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  
**Declaration:**  

<pre><code class="language-Dart">Future&lt;bool&gt; isSignedIn() async</code></pre>


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

<pre><code class="language-Dart">bool isSignedInBool = await Synerise.client.isSignedIn();</code></pre>


## 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/modules/client/client_impl.dart
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/flutter/modules#client)
  
**Declaration:**  

<pre><code class="language-Dart">Future&lt;bool&gt; isSignedInViaSimpleAuthentication() async</code></pre>

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

**Example:**  

<pre><code class="language-Dart">await Synerise.client
        .isSignedInViaSimpleAuthentication()
        .then((bool result) {
      if (result == true) {
        //result handling
      } else {
        //error handling
      }
    });</code></pre>


## 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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  
**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signOut() async</code></pre>


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

**Example:**  

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

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

```Dart
Synerise.client.signOut().whenComplete(() => {
      //onSuccess handling
    });
```

</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/modules/client/client_impl.dart
  
**Class:**  
[ClientImpl](/developers/mobile-sdk/class-reference/flutter/modules#client)
  

<div class="content-tabs" data-tab-group="tabgrp-920">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-920-0" data-tab-group="tabgrp-920" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-920-1" data-tab-group="tabgrp-920">Legacy SDK</button></div>

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

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signOutWithMode(ClientSignOutMode mode, bool fromAllDevices, {required void Function() onSuccess, required void Function(SyneriseError) onError}) async</code></pre>

    
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/flutter/client#clientsignoutmode) | yes | Mode of signing out |
| **fromAllDevices** | bool | yes | Determines if the method should sign out all devices |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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

<pre><code class="language-Dart">ClientSignOutMode mode = ClientSignOutMode.signOutWithSessionDestroy;
    bool fromAllDevices = true;
    await Synerise.client.signOutWithMode(mode, fromAllDevices, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-920-1" data-tab-group="tabgrp-920">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; signOutWithMode(ClientSignOutMode mode, bool fromAllDevices) async</code></pre>

    
**Parameters:**  
| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/flutter/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:**

<pre><code class="language-Dart">ClientSignOutMode mode = ClientSignOutMode.signOutWithSessionDestroy;
    bool fromAllDevices = true;
    await Synerise.client.signOutWithMode(mode, fromAllDevices).catchError((error) {</code></pre>

</div>
</div>



